Mercurial > libervia-backend
comparison src/bridge/DBus.py @ 538:2c4016921403
core, frontends, bridgen plugins: fixed methods which were unproperly managing multi-profiles
- added profile argument to askConfirmation, actionResult, actionResultExt, entityDataUpdated, confirmationAnswer, getProgress
- core, frontends: fixed calls/signals according to new bridge API
- user of proper profile namespace for progression indicators and dialogs
- memory: getParam* now return bool when param type is bool
- memory: added getStringParam* to return string instead of typed value
- core, memory, storage, quick_frontend: getHistory now manage properly multi-profiles
- plugins XEP-0047, XEP-0054, XEP-0065, XEP-0077, XEP-0096; multi-profiles proper handling
author | Goffi <goffi@goffi.org> |
---|---|
date | Sat, 10 Nov 2012 16:38:16 +0100 |
parents | 8ee9113d307b |
children | 8b116fa42a31 |
comparison
equal
deleted
inserted
replaced
537:28cddc96c4ed | 538:2c4016921403 |
---|---|
103 # already exist for plugins), probably missing some initialisation, need | 103 # already exist for plugins), probably missing some initialisation, need |
104 # further investigations | 104 # further investigations |
105 pass | 105 pass |
106 | 106 |
107 @dbus.service.signal(const_INT_PREFIX+const_CORE_SUFFIX, | 107 @dbus.service.signal(const_INT_PREFIX+const_CORE_SUFFIX, |
108 signature='ssa{ss}') | 108 signature='ssa{ss}s') |
109 def actionResult(self, answer_type, id, data): | 109 def actionResult(self, answer_type, id, data, profile): |
110 pass | 110 pass |
111 | 111 |
112 @dbus.service.signal(const_INT_PREFIX+const_CORE_SUFFIX, | 112 @dbus.service.signal(const_INT_PREFIX+const_CORE_SUFFIX, |
113 signature='ssa{sa{ss}}') | 113 signature='ssa{sa{ss}}s') |
114 def actionResultExt(self, answer_type, id, data): | 114 def actionResultExt(self, answer_type, id, data, profile): |
115 pass | 115 pass |
116 | 116 |
117 @dbus.service.signal(const_INT_PREFIX+const_CORE_SUFFIX, | 117 @dbus.service.signal(const_INT_PREFIX+const_CORE_SUFFIX, |
118 signature='ssa{ss}') | 118 signature='ssa{ss}s') |
119 def askConfirmation(self, conf_type, id, data): | 119 def askConfirmation(self, conf_type, id, data, profile): |
120 pass | 120 pass |
121 | 121 |
122 @dbus.service.signal(const_INT_PREFIX+const_CORE_SUFFIX, | 122 @dbus.service.signal(const_INT_PREFIX+const_CORE_SUFFIX, |
123 signature='s') | 123 signature='s') |
124 def connected(self, profile): | 124 def connected(self, profile): |
206 async_callbacks=None) | 206 async_callbacks=None) |
207 def callMenu(self, category, name, menu_type, profile_key): | 207 def callMenu(self, category, name, menu_type, profile_key): |
208 return self._callback("callMenu", unicode(category), unicode(name), unicode(menu_type), unicode(profile_key)) | 208 return self._callback("callMenu", unicode(category), unicode(name), unicode(menu_type), unicode(profile_key)) |
209 | 209 |
210 @dbus.service.method(const_INT_PREFIX+const_CORE_SUFFIX, | 210 @dbus.service.method(const_INT_PREFIX+const_CORE_SUFFIX, |
211 in_signature='sba{ss}', out_signature='', | 211 in_signature='sba{ss}s', out_signature='', |
212 async_callbacks=None) | 212 async_callbacks=None) |
213 def confirmationAnswer(self, id, accepted, data): | 213 def confirmationAnswer(self, id, accepted, data, profile): |
214 return self._callback("confirmationAnswer", unicode(id), accepted, data) | 214 return self._callback("confirmationAnswer", unicode(id), accepted, data, unicode(profile)) |
215 | 215 |
216 @dbus.service.method(const_INT_PREFIX+const_CORE_SUFFIX, | 216 @dbus.service.method(const_INT_PREFIX+const_CORE_SUFFIX, |
217 in_signature='s', out_signature='', | 217 in_signature='s', out_signature='', |
218 async_callbacks=None) | 218 async_callbacks=None) |
219 def connect(self, profile_key="@DEFAULT@"): | 219 def connect(self, profile_key="@DEFAULT@"): |
266 async_callbacks=None) | 266 async_callbacks=None) |
267 def getEntityData(self, jid, keys, profile): | 267 def getEntityData(self, jid, keys, profile): |
268 return self._callback("getEntityData", unicode(jid), keys, unicode(profile)) | 268 return self._callback("getEntityData", unicode(jid), keys, unicode(profile)) |
269 | 269 |
270 @dbus.service.method(const_INT_PREFIX+const_CORE_SUFFIX, | 270 @dbus.service.method(const_INT_PREFIX+const_CORE_SUFFIX, |
271 in_signature='ssib', out_signature='a(dssss)', | 271 in_signature='ssibs', out_signature='a(dssss)', |
272 async_callbacks=('callback', 'errback')) | 272 async_callbacks=('callback', 'errback')) |
273 def getHistory(self, from_jid, to_jid, limit, between=True, callback=None, errback=None): | 273 def getHistory(self, from_jid, to_jid, limit, between=True, profile="@NONE@", callback=None, errback=None): |
274 return self._callback("getHistory", unicode(from_jid), unicode(to_jid), limit, between, callback=callback, errback=errback) | 274 return self._callback("getHistory", unicode(from_jid), unicode(to_jid), limit, between, unicode(profile), callback=callback, errback=errback) |
275 | 275 |
276 @dbus.service.method(const_INT_PREFIX+const_CORE_SUFFIX, | 276 @dbus.service.method(const_INT_PREFIX+const_CORE_SUFFIX, |
277 in_signature='ss', out_signature='s', | 277 in_signature='ss', out_signature='s', |
278 async_callbacks=None) | 278 async_callbacks=None) |
279 def getLastResource(self, contact_jid, profile_key="@DEFAULT@"): | 279 def getLastResource(self, contact_jid, profile_key="@DEFAULT@"): |
338 async_callbacks=None) | 338 async_callbacks=None) |
339 def getProfilesList(self, ): | 339 def getProfilesList(self, ): |
340 return self._callback("getProfilesList", ) | 340 return self._callback("getProfilesList", ) |
341 | 341 |
342 @dbus.service.method(const_INT_PREFIX+const_CORE_SUFFIX, | 342 @dbus.service.method(const_INT_PREFIX+const_CORE_SUFFIX, |
343 in_signature='s', out_signature='a{ss}', | 343 in_signature='ss', out_signature='a{ss}', |
344 async_callbacks=None) | 344 async_callbacks=None) |
345 def getProgress(self, id): | 345 def getProgress(self, id, profile): |
346 return self._callback("getProgress", unicode(id)) | 346 return self._callback("getProgress", unicode(id), unicode(profile)) |
347 | 347 |
348 @dbus.service.method(const_INT_PREFIX+const_CORE_SUFFIX, | 348 @dbus.service.method(const_INT_PREFIX+const_CORE_SUFFIX, |
349 in_signature='', out_signature='s', | 349 in_signature='', out_signature='s', |
350 async_callbacks=None) | 350 async_callbacks=None) |
351 def getVersion(self, ): | 351 def getVersion(self, ): |
501 info ("Init DBus...") | 501 info ("Init DBus...") |
502 self.session_bus = dbus.SessionBus() | 502 self.session_bus = dbus.SessionBus() |
503 self.dbus_name = dbus.service.BusName(const_INT_PREFIX, self.session_bus) | 503 self.dbus_name = dbus.service.BusName(const_INT_PREFIX, self.session_bus) |
504 self.dbus_bridge = DbusObject(self.session_bus, const_OBJ_PATH) | 504 self.dbus_bridge = DbusObject(self.session_bus, const_OBJ_PATH) |
505 | 505 |
506 def actionResult(self, answer_type, id, data): | 506 def actionResult(self, answer_type, id, data, profile): |
507 self.dbus_bridge.actionResult(answer_type, id, data) | 507 self.dbus_bridge.actionResult(answer_type, id, data, profile) |
508 | 508 |
509 def actionResultExt(self, answer_type, id, data): | 509 def actionResultExt(self, answer_type, id, data, profile): |
510 self.dbus_bridge.actionResultExt(answer_type, id, data) | 510 self.dbus_bridge.actionResultExt(answer_type, id, data, profile) |
511 | 511 |
512 def askConfirmation(self, conf_type, id, data): | 512 def askConfirmation(self, conf_type, id, data, profile): |
513 self.dbus_bridge.askConfirmation(conf_type, id, data) | 513 self.dbus_bridge.askConfirmation(conf_type, id, data, profile) |
514 | 514 |
515 def connected(self, profile): | 515 def connected(self, profile): |
516 self.dbus_bridge.connected(profile) | 516 self.dbus_bridge.connected(profile) |
517 | 517 |
518 def connectionError(self, error_type, profile): | 518 def connectionError(self, error_type, profile): |