Author: justi9
Date: 2008-03-01 14:26:44 -0500 (Sat, 01 Mar 2008)
New Revision: 1745
Modified:
mgmt/basil/python/basil/__init__.py
Log:
Create new methods such that you don't have to pass the name arg.
Rename method to basil_call to avoid collisions.
Fix a bug in the connection close code.
Modified: mgmt/basil/python/basil/__init__.py
===================================================================
--- mgmt/basil/python/basil/__init__.py 2008-03-01 16:38:19 UTC (rev 1744)
+++ mgmt/basil/python/basil/__init__.py 2008-03-01 19:26:44 UTC (rev 1745)
@@ -1,4 +1,4 @@
-import mllib, qpid
+import mllib, qpid, new
from string import Template
from qpid.management import managementChannel, managementClient
from threading import Lock
@@ -114,7 +114,9 @@
setattr(self.python_class, spec[0], None)
for name in methods:
- setattr(self.python_class, name, self.python_class.method)
+ def meth(this, callback, **kwargs):
+ this.basil_call(name, callback, **kwargs)
+ setattr(self.python_class, name, meth)
for spec in events:
pass
@@ -157,7 +159,7 @@
self.basil_context_id = context_id
self.basil_object_id = object_id
- def method(self, name, callback, **kwargs):
+ def basil_call(self, name, callback, **kwargs):
model = self.basil_model
model.lock.acquire()
try:
@@ -207,4 +209,4 @@
def close(self):
self.client.removeChannel(self.chan)
- client.close()
+ self.client.close()
Show replies by date