diff sat.tac @ 25:53e921c8a357

new plugin: gateways plugin, and first implementation of findGateways - test menu in Wix - new actionResultExt method, for sending dictionary of dictionaries - new getNextId method, for accessing sat ids from plugins.
author Goffi <goffi@goffi.org>
date Fri, 04 Dec 2009 08:47:44 +0100
parents 925ab466c5ec
children d6b613764dd7
line wrap: on
line diff
--- a/sat.tac	Tue Dec 01 07:55:46 2009 +0100
+++ b/sat.tac	Fri Dec 04 08:47:44 2009 +0100
@@ -244,7 +244,10 @@
         
 
 class SAT(service.Service):
-    
+   
+    def get_next_id(self):
+        return sat_next_id()
+
     def __init__(self):
         #TODO: standardize callback system
         self.__waiting_conf = {}  #callback called when a confirmation is received
@@ -515,16 +518,28 @@
         for cat, type in disco.identities:
             debug ("Identity found: [%s/%s] %s" % (cat, type, disco.identities[(cat,type)]))
 
+    
     ## Generic HMI ## 
     
     def actionResult(self, id, type, data):
         """Send the result of an action
         @param id: same id used with action
         @type: result type ("PARAM", "SUCCESS", "ERROR")
-        @data: data (depend of result type)
+        @data: dictionary
         """
         self.bridge.actionResult(type, id, data)
 
+    def actionResultExt(self, id, type, data):
+        """Send the result of an action, extended version
+        @param id: same id used with action
+        @type: result type ("PARAM", "SUCCESS", "ERROR")
+        @data: dictionary of dictionaries
+        """
+        if type != "DICT_DICT":
+            error("type for actionResultExt must be DICT_DICT, fixing it")
+            type = "DICT_DICT"
+        self.bridge.actionResultExt(type, id, data)
+
 
 
     def askConfirmation(self, id, type, data, cb):