diff 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
line wrap: on
line diff
--- a/src/bridge/DBus.py	Fri Sep 25 19:19:12 2015 +0200
+++ b/src/bridge/DBus.py	Fri Sep 25 19:19:12 2015 +0200
@@ -192,6 +192,21 @@
 
     @dbus.service.signal(const_INT_PREFIX+const_CORE_SUFFIX,
                          signature='sss')
+    def progressError(self, error, profile, arg_2):
+        pass
+
+    @dbus.service.signal(const_INT_PREFIX+const_CORE_SUFFIX,
+                         signature='ss')
+    def progressFinished(self, id, profile):
+        pass
+
+    @dbus.service.signal(const_INT_PREFIX+const_CORE_SUFFIX,
+                         signature='ss')
+    def progressStarted(self, id, profile):
+        pass
+
+    @dbus.service.signal(const_INT_PREFIX+const_CORE_SUFFIX,
+                         signature='sss')
     def subscribe(self, sub_type, entity_jid, profile):
         pass
 
@@ -366,12 +381,6 @@
         return self._callback("getProfilesList", )
 
     @dbus.service.method(const_INT_PREFIX+const_CORE_SUFFIX,
-                         in_signature='ss', out_signature='a{ss}',
-                         async_callbacks=None)
-    def getProgress(self, id, profile):
-        return self._callback("getProgress", unicode(id), unicode(profile))
-
-    @dbus.service.method(const_INT_PREFIX+const_CORE_SUFFIX,
                          in_signature='', out_signature='',
                          async_callbacks=('callback', 'errback'))
     def getReady(self, callback=None, errback=None):
@@ -420,6 +429,18 @@
         return self._callback("paramsRegisterApp", unicode(xml), security_limit, unicode(app))
 
     @dbus.service.method(const_INT_PREFIX+const_CORE_SUFFIX,
+                         in_signature='ss', out_signature='a{ss}',
+                         async_callbacks=None)
+    def progressGet(self, id, profile):
+        return self._callback("progressGet", unicode(id), unicode(profile))
+
+    @dbus.service.method(const_INT_PREFIX+const_CORE_SUFFIX,
+                         in_signature='s', out_signature='a{sa{sa{ss}}}',
+                         async_callbacks=None)
+    def progressGetAll(self, profile):
+        return self._callback("progressGetAll", unicode(profile))
+
+    @dbus.service.method(const_INT_PREFIX+const_CORE_SUFFIX,
                          in_signature='s', out_signature='b',
                          async_callbacks=None)
     def saveParamsTemplate(self, filename):
@@ -596,6 +617,15 @@
     def presenceUpdate(self, entity_jid, show, priority, statuses, profile):
         self.dbus_bridge.presenceUpdate(entity_jid, show, priority, statuses, profile)
 
+    def progressError(self, error, profile, arg_2):
+        self.dbus_bridge.progressError(error, profile, arg_2)
+
+    def progressFinished(self, id, profile):
+        self.dbus_bridge.progressFinished(id, profile)
+
+    def progressStarted(self, id, profile):
+        self.dbus_bridge.progressStarted(id, profile)
+
     def subscribe(self, sub_type, entity_jid, profile):
         self.dbus_bridge.subscribe(sub_type, entity_jid, profile)