bump version 0.6.0
[contrib/cloudeebus.git] / cloudeebus / cloudeebus.py
index 681d6f8..c7109b9 100755 (executable)
@@ -51,7 +51,7 @@ from xml.etree.ElementTree import XMLParser
 
 ###############################################################################
 
-VERSION = "0.5.99"
+VERSION = "0.6.0"
 OPENDOOR = False
 CREDENTIALS = {}
 WHITELIST = []
@@ -527,14 +527,19 @@ class CloudeebusService:
     @exportRpc
     def emitSignal(self, list):
         '''
-        arguments: agentObjectPath, signalName, result (to emit)
+        arguments: agentObjectPath, signalName, args (to emit)
         '''
         objectPath = list[0]
         className = re.sub('/', '_', objectPath[1:])
         signalName = list[1]
-        result = list[2]
-        if (self.serviceAgents.has_key(className) == True):
-            exe_str = "self.serviceAgents['"+ className +"']."+ signalName + "(" + str(result) + ")"
+        args = json.loads(list[2])
+        if (self.serviceAgents.has_key(className) == True):            
+            exe_str = "self.serviceAgents['"+ className +"']."+ signalName + "("
+            if len(args) > 0:
+                exe_str += json.dumps(args[0])
+                for idx in args[1:]:
+                    exe_str += "," + json.dumps(idx)
+            exe_str += ")"               
             eval(exe_str, self.globalCtx, self.localCtx)
         else:
             raise Exception("No object path " + objectPath)
@@ -644,8 +649,6 @@ class CloudeebusService:
         agentObjectPath = list[0]
         className = createClassName(agentObjectPath)
         
-        print 'PY Try to remove ' + className
-
         if (self.serviceAgents.has_key(className)):
             self.serviceAgents[className].remove_from_connection()
             self.serviceAgents.pop(className)