comparison sat_bridge/DBus.py @ 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
58 def presenceUpdate(self, jid, type, show, status, priority): 58 def presenceUpdate(self, jid, type, show, status, priority):
59 debug("presence update signal (from:%s type: %s show:%s status:\"%s\" priority:%d) sended" , jid, type, show, status, priority) 59 debug("presence update signal (from:%s type: %s show:%s status:\"%s\" priority:%d) sended" , jid, type, show, status, priority)
60 60
61 @dbus.service.signal(const_INT_PREFIX+const_COMM_SUFFIX, 61 @dbus.service.signal(const_INT_PREFIX+const_COMM_SUFFIX,
62 signature='sss') 62 signature='sss')
63 def paramUpdate(self, name, value, namespace): 63 def paramUpdate(self, name, value, category):
64 debug("param update signal: %s=%s in namespace %s", name, value, namespace) 64 debug("param update signal: %s=%s in category %s", name, value, category)
65 65
66 @dbus.service.signal(const_INT_PREFIX+const_COMM_SUFFIX, 66 @dbus.service.signal(const_INT_PREFIX+const_COMM_SUFFIX,
67 signature='s') 67 signature='s')
68 def contactDeleted(self, jid): 68 def contactDeleted(self, jid):
69 debug("contact deleted signal: %s", jid) 69 debug("contact deleted signal: %s", jid)
124 @dbus.service.method(const_INT_PREFIX+const_COMM_SUFFIX, 124 @dbus.service.method(const_INT_PREFIX+const_COMM_SUFFIX,
125 in_signature='sss', out_signature='') 125 in_signature='sss', out_signature='')
126 def setParam(self, name, value, category): 126 def setParam(self, name, value, category):
127 self.cb["setParam"](name, str(value), category) 127 self.cb["setParam"](name, str(value), category)
128 128
129 """@dbus.service.method(const_INT_PREFIX+const_COMM_SUFFIX, 129 @dbus.service.method(const_INT_PREFIX+const_COMM_SUFFIX,
130 in_signature='ss', out_signature='(ss)') 130 in_signature='ss', out_signature='s')
131 def getParam(self, name, namespace="default"): 131 def getParamV(self, name, category="default"):
132 return self.cb["getParam"](name, namespace)""" 132 return self.cb["getParamV"](name, category)
133
134 """@dbus.service.method(const_INT_PREFIX+const_COMM_SUFFIX,
135 in_signature='s', out_signature='a(sss)')
136 def getParams(self, namespace):
137 return self.cb["getParams"](namespace)"""
138 133
139 @dbus.service.method(const_INT_PREFIX+const_COMM_SUFFIX, 134 @dbus.service.method(const_INT_PREFIX+const_COMM_SUFFIX,
140 in_signature='', out_signature='s') 135 in_signature='', out_signature='s')
141 def getParams(self): 136 def getParams(self):
142 return self.cb["getParams"]() 137 return self.cb["getParams"]()
138
139 @dbus.service.method(const_INT_PREFIX+const_COMM_SUFFIX,
140 in_signature='s', out_signature='s')
141 def getParamsForCategory(self, category):
142 return self.cb["getParamsForCategory"](category)
143 143
144 @dbus.service.method(const_INT_PREFIX+const_COMM_SUFFIX, 144 @dbus.service.method(const_INT_PREFIX+const_COMM_SUFFIX,
145 in_signature='', out_signature='as') 145 in_signature='', out_signature='as')
146 def getParamsCategories(self): 146 def getParamsCategories(self):
147 return self.cb["getParamsCategories"]() 147 return self.cb["getParamsCategories"]()
234 234
235 def presenceUpdate(self, jid, type, show, status, priority): 235 def presenceUpdate(self, jid, type, show, status, priority):
236 debug("updating presence for %s",jid) 236 debug("updating presence for %s",jid)
237 self.dbus_bridge.presenceUpdate(jid, type, show, status, priority) 237 self.dbus_bridge.presenceUpdate(jid, type, show, status, priority)
238 238
239 def paramUpdate(self, name, value, namespace): 239 def paramUpdate(self, name, value, category):
240 debug("updating param [%s] %s ", namespace, name) 240 debug("updating param [%s] %s ", category, name)
241 self.dbus_bridge.paramUpdate(name, value, namespace) 241 self.dbus_bridge.paramUpdate(name, value, category)
242 242
243 def contactDeleted(self, jid): 243 def contactDeleted(self, jid):
244 debug("sending contact deleted signal %s ", jid) 244 debug("sending contact deleted signal %s ", jid)
245 self.dbus_bridge.contactDeleted(jid) 245 self.dbus_bridge.contactDeleted(jid)
246 246