comparison src/bridge/DBus.py @ 1522:7d7e57a84792

core: progression handling improvments: - getProgress has been renamed to progressGet to follown new naming convention - new signals: progressStarted, progressFinished and progressError to indicate state of progressing events - new method progressGetAll to get all progressing events of all profile (or only one profile)
author Goffi <goffi@goffi.org>
date Fri, 25 Sep 2015 19:19:12 +0200
parents 80cd55dd5b04
children 42285d993e68
comparison
equal deleted inserted replaced
1521:d2ab9c62ac3a 1522:7d7e57a84792
190 def presenceUpdate(self, entity_jid, show, priority, statuses, profile): 190 def presenceUpdate(self, entity_jid, show, priority, statuses, profile):
191 pass 191 pass
192 192
193 @dbus.service.signal(const_INT_PREFIX+const_CORE_SUFFIX, 193 @dbus.service.signal(const_INT_PREFIX+const_CORE_SUFFIX,
194 signature='sss') 194 signature='sss')
195 def progressError(self, error, profile, arg_2):
196 pass
197
198 @dbus.service.signal(const_INT_PREFIX+const_CORE_SUFFIX,
199 signature='ss')
200 def progressFinished(self, id, profile):
201 pass
202
203 @dbus.service.signal(const_INT_PREFIX+const_CORE_SUFFIX,
204 signature='ss')
205 def progressStarted(self, id, profile):
206 pass
207
208 @dbus.service.signal(const_INT_PREFIX+const_CORE_SUFFIX,
209 signature='sss')
195 def subscribe(self, sub_type, entity_jid, profile): 210 def subscribe(self, sub_type, entity_jid, profile):
196 pass 211 pass
197 212
198 ### methods ### 213 ### methods ###
199 214
364 async_callbacks=None) 379 async_callbacks=None)
365 def getProfilesList(self, ): 380 def getProfilesList(self, ):
366 return self._callback("getProfilesList", ) 381 return self._callback("getProfilesList", )
367 382
368 @dbus.service.method(const_INT_PREFIX+const_CORE_SUFFIX, 383 @dbus.service.method(const_INT_PREFIX+const_CORE_SUFFIX,
369 in_signature='ss', out_signature='a{ss}',
370 async_callbacks=None)
371 def getProgress(self, id, profile):
372 return self._callback("getProgress", unicode(id), unicode(profile))
373
374 @dbus.service.method(const_INT_PREFIX+const_CORE_SUFFIX,
375 in_signature='', out_signature='', 384 in_signature='', out_signature='',
376 async_callbacks=('callback', 'errback')) 385 async_callbacks=('callback', 'errback'))
377 def getReady(self, callback=None, errback=None): 386 def getReady(self, callback=None, errback=None):
378 return self._callback("getReady", callback=callback, errback=errback) 387 return self._callback("getReady", callback=callback, errback=errback)
379 388
416 @dbus.service.method(const_INT_PREFIX+const_CORE_SUFFIX, 425 @dbus.service.method(const_INT_PREFIX+const_CORE_SUFFIX,
417 in_signature='sis', out_signature='', 426 in_signature='sis', out_signature='',
418 async_callbacks=None) 427 async_callbacks=None)
419 def paramsRegisterApp(self, xml, security_limit=-1, app=''): 428 def paramsRegisterApp(self, xml, security_limit=-1, app=''):
420 return self._callback("paramsRegisterApp", unicode(xml), security_limit, unicode(app)) 429 return self._callback("paramsRegisterApp", unicode(xml), security_limit, unicode(app))
430
431 @dbus.service.method(const_INT_PREFIX+const_CORE_SUFFIX,
432 in_signature='ss', out_signature='a{ss}',
433 async_callbacks=None)
434 def progressGet(self, id, profile):
435 return self._callback("progressGet", unicode(id), unicode(profile))
436
437 @dbus.service.method(const_INT_PREFIX+const_CORE_SUFFIX,
438 in_signature='s', out_signature='a{sa{sa{ss}}}',
439 async_callbacks=None)
440 def progressGetAll(self, profile):
441 return self._callback("progressGetAll", unicode(profile))
421 442
422 @dbus.service.method(const_INT_PREFIX+const_CORE_SUFFIX, 443 @dbus.service.method(const_INT_PREFIX+const_CORE_SUFFIX,
423 in_signature='s', out_signature='b', 444 in_signature='s', out_signature='b',
424 async_callbacks=None) 445 async_callbacks=None)
425 def saveParamsTemplate(self, filename): 446 def saveParamsTemplate(self, filename):
594 self.dbus_bridge.paramUpdate(name, value, category, profile) 615 self.dbus_bridge.paramUpdate(name, value, category, profile)
595 616
596 def presenceUpdate(self, entity_jid, show, priority, statuses, profile): 617 def presenceUpdate(self, entity_jid, show, priority, statuses, profile):
597 self.dbus_bridge.presenceUpdate(entity_jid, show, priority, statuses, profile) 618 self.dbus_bridge.presenceUpdate(entity_jid, show, priority, statuses, profile)
598 619
620 def progressError(self, error, profile, arg_2):
621 self.dbus_bridge.progressError(error, profile, arg_2)
622
623 def progressFinished(self, id, profile):
624 self.dbus_bridge.progressFinished(id, profile)
625
626 def progressStarted(self, id, profile):
627 self.dbus_bridge.progressStarted(id, profile)
628
599 def subscribe(self, sub_type, entity_jid, profile): 629 def subscribe(self, sub_type, entity_jid, profile):
600 self.dbus_bridge.subscribe(sub_type, entity_jid, profile) 630 self.dbus_bridge.subscribe(sub_type, entity_jid, profile)
601 631
602 def register(self, name, callback): 632 def register(self, name, callback):
603 log.debug("registering DBus bridge method [%s]" % name) 633 log.debug("registering DBus bridge method [%s]" % name)