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.
This commit is contained in:
Goffi 2009-12-04 08:47:44 +01:00
commit 77cd653fa6

19
sat.tac
View file

@ -244,7 +244,10 @@ class RegisteringAuthenticator(xmlstream.ConnectAuthenticator):
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 @@ class SAT(service.Service):
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):