comparison src/bridge/DBus.py @ 1626:63cef4dbf2a4

core, plugins file, XEP-0234, bridge: progression api enhancement: - progressStarted have a new metadata parameter, useful to know the kind of progression, direction, etc. Check bridge doc - progressGetAllMetadata can be used to retrieve this data and discover on currently running progressions - progressFinished also have a new metadata parameter, used to e.g. indicate that hash is checked - core: fixed progressGetAll - file, XEP-0234: implemented the API modifications, hash is returned on progressFinished - file: SatFile.checkSize allows to check size independently of close (be sure that all the data have been transfered though)
author Goffi <goffi@goffi.org>
date Thu, 19 Nov 2015 18:13:26 +0100
parents 5b24d6bf5d15
children d17772b0fe22
comparison
equal deleted inserted replaced
1625:8b8b1af5905f 1626:63cef4dbf2a4
194 signature='sss') 194 signature='sss')
195 def progressError(self, error, profile, arg_2): 195 def progressError(self, error, profile, arg_2):
196 pass 196 pass
197 197
198 @dbus.service.signal(const_INT_PREFIX+const_CORE_SUFFIX, 198 @dbus.service.signal(const_INT_PREFIX+const_CORE_SUFFIX,
199 signature='ss') 199 signature='sa{ss}s')
200 def progressFinished(self, id, profile): 200 def progressFinished(self, id, metadata, profile):
201 pass 201 pass
202 202
203 @dbus.service.signal(const_INT_PREFIX+const_CORE_SUFFIX, 203 @dbus.service.signal(const_INT_PREFIX+const_CORE_SUFFIX,
204 signature='ss') 204 signature='sa{ss}s')
205 def progressStarted(self, id, profile): 205 def progressStarted(self, id, metadata, profile):
206 pass 206 pass
207 207
208 @dbus.service.signal(const_INT_PREFIX+const_CORE_SUFFIX, 208 @dbus.service.signal(const_INT_PREFIX+const_CORE_SUFFIX,
209 signature='sss') 209 signature='sss')
210 def subscribe(self, sub_type, entity_jid, profile): 210 def subscribe(self, sub_type, entity_jid, profile):
455 @dbus.service.method(const_INT_PREFIX+const_CORE_SUFFIX, 455 @dbus.service.method(const_INT_PREFIX+const_CORE_SUFFIX,
456 in_signature='s', out_signature='a{sa{sa{ss}}}', 456 in_signature='s', out_signature='a{sa{sa{ss}}}',
457 async_callbacks=None) 457 async_callbacks=None)
458 def progressGetAll(self, profile): 458 def progressGetAll(self, profile):
459 return self._callback("progressGetAll", unicode(profile)) 459 return self._callback("progressGetAll", unicode(profile))
460
461 @dbus.service.method(const_INT_PREFIX+const_CORE_SUFFIX,
462 in_signature='s', out_signature='a{sa{sa{ss}}}',
463 async_callbacks=None)
464 def progressGetAllMetadata(self, profile):
465 return self._callback("progressGetAllMetadata", unicode(profile))
460 466
461 @dbus.service.method(const_INT_PREFIX+const_CORE_SUFFIX, 467 @dbus.service.method(const_INT_PREFIX+const_CORE_SUFFIX,
462 in_signature='s', out_signature='b', 468 in_signature='s', out_signature='b',
463 async_callbacks=None) 469 async_callbacks=None)
464 def saveParamsTemplate(self, filename): 470 def saveParamsTemplate(self, filename):
636 self.dbus_bridge.presenceUpdate(entity_jid, show, priority, statuses, profile) 642 self.dbus_bridge.presenceUpdate(entity_jid, show, priority, statuses, profile)
637 643
638 def progressError(self, error, profile, arg_2): 644 def progressError(self, error, profile, arg_2):
639 self.dbus_bridge.progressError(error, profile, arg_2) 645 self.dbus_bridge.progressError(error, profile, arg_2)
640 646
641 def progressFinished(self, id, profile): 647 def progressFinished(self, id, metadata, profile):
642 self.dbus_bridge.progressFinished(id, profile) 648 self.dbus_bridge.progressFinished(id, metadata, profile)
643 649
644 def progressStarted(self, id, profile): 650 def progressStarted(self, id, metadata, profile):
645 self.dbus_bridge.progressStarted(id, profile) 651 self.dbus_bridge.progressStarted(id, metadata, profile)
646 652
647 def subscribe(self, sub_type, entity_jid, profile): 653 def subscribe(self, sub_type, entity_jid, profile):
648 self.dbus_bridge.subscribe(sub_type, entity_jid, profile) 654 self.dbus_bridge.subscribe(sub_type, entity_jid, profile)
649 655
650 def register(self, name, callback): 656 def register(self, name, callback):