[svn r63562] fixing _com regarding pyevents as well
--HG-- branch : trunk
This commit is contained in:
parent
54cc936437
commit
e7e1b2725b
|
@ -51,7 +51,11 @@ class MultiCall:
|
||||||
if needscall:
|
if needscall:
|
||||||
res = currentmethod(self, *self.args, **self.kwargs)
|
res = currentmethod(self, *self.args, **self.kwargs)
|
||||||
else:
|
else:
|
||||||
|
#try:
|
||||||
res = currentmethod(*self.args, **self.kwargs)
|
res = currentmethod(*self.args, **self.kwargs)
|
||||||
|
#except TypeError:
|
||||||
|
# print currentmethod.__module__, currentmethod.__name__, self.args, self.kwargs
|
||||||
|
# raise
|
||||||
if hasattr(self, '_ex1'):
|
if hasattr(self, '_ex1'):
|
||||||
self.results = [res]
|
self.results = [res]
|
||||||
break
|
break
|
||||||
|
@ -152,7 +156,6 @@ class PyPlugins:
|
||||||
MultiCall(self.listattr("pyevent__" + eventname),
|
MultiCall(self.listattr("pyevent__" + eventname),
|
||||||
*args, **kwargs).execute()
|
*args, **kwargs).execute()
|
||||||
#print "calling anonymous hooks", args, kwargs
|
#print "calling anonymous hooks", args, kwargs
|
||||||
MultiCall(self.listattr("pyevent"),
|
MultiCall(self.listattr("pyevent"), eventname, args, kwargs).execute()
|
||||||
eventname, *args, **kwargs).execute()
|
|
||||||
|
|
||||||
pyplugins = PyPlugins()
|
pyplugins = PyPlugins()
|
||||||
|
|
|
@ -181,7 +181,7 @@ class TestPyPlugins:
|
||||||
def pyevent__hello(self):
|
def pyevent__hello(self):
|
||||||
l.append("hellospecific")
|
l.append("hellospecific")
|
||||||
class api2:
|
class api2:
|
||||||
def pyevent(self, name, *args):
|
def pyevent(self, name, args, kwargs):
|
||||||
if name == "hello":
|
if name == "hello":
|
||||||
l.append(name + "anonymous")
|
l.append(name + "anonymous")
|
||||||
plugins.register(api1())
|
plugins.register(api1())
|
||||||
|
@ -240,7 +240,7 @@ class TestPyPluginsEvents:
|
||||||
plugins = PyPlugins()
|
plugins = PyPlugins()
|
||||||
l = []
|
l = []
|
||||||
class A:
|
class A:
|
||||||
def pyevent(self, name, *args, **kwargs):
|
def pyevent(self, name, args, kwargs):
|
||||||
if name == "name":
|
if name == "name":
|
||||||
l.extend([args, kwargs])
|
l.extend([args, kwargs])
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue