comparison sat.tac @ 18:6928e3cb73a8

refactoring: using xml params part II
author Goffi <goffi@goffi.org>
date Fri, 06 Nov 2009 23:31:00 +0100
parents 74a39f40eb6d
children bb72c29f3432
comparison
equal deleted inserted replaced
17:74a39f40eb6d 18:6928e3cb73a8
84 84
85 def isConnected(self): 85 def isConnected(self):
86 return self.__connected 86 return self.__connected
87 87
88 def connectionLost(self, connector, unused_reason): 88 def connectionLost(self, connector, unused_reason):
89 self.__connected=False
89 print "********** DISCONNECTED **********" 90 print "********** DISCONNECTED **********"
90 try: 91 try:
91 self.keep_alife.stop() 92 self.keep_alife.stop()
92 except AttributeError: 93 except AttributeError:
93 debug("No keep_alife") 94 debug("No keep_alife")
256 self.bridge.register("disconnect", self.disconnect) 257 self.bridge.register("disconnect", self.disconnect)
257 self.bridge.register("getContacts", self.memory.getContacts) 258 self.bridge.register("getContacts", self.memory.getContacts)
258 self.bridge.register("getPresenceStatus", self.memory.getPresenceStatus) 259 self.bridge.register("getPresenceStatus", self.memory.getPresenceStatus)
259 self.bridge.register("sendMessage", self.sendMessage) 260 self.bridge.register("sendMessage", self.sendMessage)
260 self.bridge.register("setParam", self.setParam) 261 self.bridge.register("setParam", self.setParam)
261 #self.bridge.register("getParam", self.memory.getParam) 262 self.bridge.register("getParamV", self.memory.getParamV)
262 self.bridge.register("getParams", self.memory.getParams) 263 self.bridge.register("getParams", self.memory.getParams)
264 self.bridge.register("getParamsForCategory", self.memory.getParamsForCategory)
263 self.bridge.register("getParamsCategories", self.memory.getParamsCategories) 265 self.bridge.register("getParamsCategories", self.memory.getParamsCategories)
264 self.bridge.register("getHistory", self.memory.getHistory) 266 self.bridge.register("getHistory", self.memory.getHistory)
265 self.bridge.register("setPresence", self.setPresence) 267 self.bridge.register("setPresence", self.setPresence)
266 self.bridge.register("addContact", self.addContact) 268 self.bridge.register("addContact", self.addContact)
267 self.bridge.register("delContact", self.delContact) 269 self.bridge.register("delContact", self.delContact)
374 376
375 return next_id 377 return next_id
376 378
377 ## Client management ## 379 ## Client management ##
378 380
379 def setParam(self, name, value, namespace): 381 def setParam(self, name, value, category):
380 """set wanted paramater and notice observers""" 382 """set wanted paramater and notice observers"""
381 info ("setting param: %s=%s in namespace %s", name, value, namespace) 383 info ("setting param: %s=%s in category %s", name, value, category)
382 self.memory.setParam(name, value, namespace) 384 self.memory.setParam(name, value, category)
383 self.bridge.paramUpdate(name, value, namespace) 385 self.bridge.paramUpdate(name, value, category)
384 386
385 def failed(self,xmlstream): 387 def failed(self,xmlstream):
386 debug("failed: %s", xmlstream.getErrorMessage()) 388 debug("failed: %s", xmlstream.getErrorMessage())
387 debug("failed: %s", dir(xmlstream)) 389 debug("failed: %s", dir(xmlstream))
388 390