changeset 360:6b5626c37909

bridge: regenerated DBus bridge
author Goffi <goffi@goffi.org>
date Mon, 06 Jun 2011 21:55:59 +0200 (2011-06-06)
parents eb9d33ba4e36
children 141eeb7cd9e6
files frontends/src/bridge/DBus.py src/bridge/DBus.py
diffstat 2 files changed, 11 insertions(+), 5 deletions(-) [+]
line wrap: on
line diff
--- a/frontends/src/bridge/DBus.py	Mon Jun 06 18:35:30 2011 +0200
+++ b/frontends/src/bridge/DBus.py	Mon Jun 06 21:55:59 2011 +0200
@@ -23,6 +23,11 @@
 import dbus, dbus.glib
 from logging import debug
 
+const_INT_PREFIX = "org.goffi.SAT"  #Interface prefix
+const_OBJ_PATH = '/org/goffi/SAT/bridge'
+const_COMM_SUFFIX = ".communication"
+const_REQ_SUFFIX = ".request"
+
 class BridgeExceptionNoService(Exception):
     pass
 
@@ -30,12 +35,12 @@
     def __init__(self):
         try:
             self.sessions_bus = dbus.SessionBus()
-            self.db_object = self.sessions_bus.get_object('org.goffi.SAT',
-                                '/org/goffi/SAT/bridge')
+            self.db_object = self.sessions_bus.get_object(const_INT_PREFIX,
+                                const_OBJ_PATH)
             self.db_comm_iface = dbus.Interface(self.db_object,
-                                dbus_interface='org.goffi.SAT.communication')
+                                dbus_interface=const_INT_PREFIX + const_COMM_SUFFIX)
             self.db_req_iface = dbus.Interface(self.db_object,
-                                dbus_interface='org.goffi.SAT.request')
+                                dbus_interface=const_INT_PREFIX + const_REQ_SUFFIX)
         except dbus.exceptions.DBusException,e:
             if e._dbus_error_name=='org.freedesktop.DBus.Error.ServiceUnknown':
                 raise BridgeExceptionNoService
--- a/src/bridge/DBus.py	Mon Jun 06 18:35:30 2011 +0200
+++ b/src/bridge/DBus.py	Mon Jun 06 21:55:59 2011 +0200
@@ -27,6 +27,7 @@
 from logging import debug, info
 
 const_INT_PREFIX = "org.goffi.SAT"  #Interface prefix
+const_OBJ_PATH = '/org/goffi/SAT/bridge'
 const_COMM_SUFFIX = ".communication"
 const_REQ_SUFFIX = ".request"
 
@@ -385,7 +386,7 @@
         info ("Init DBus...")
         self.session_bus = dbus.SessionBus()
         self.dbus_name = dbus.service.BusName(const_INT_PREFIX, self.session_bus)
-        self.dbus_bridge = DbusObject(self.session_bus, '/org/goffi/SAT/bridge')
+        self.dbus_bridge = DbusObject(self.session_bus, const_OBJ_PATH)
 
     def actionResult(self, answer_type, id, data):
         self.dbus_bridge.actionResult(answer_type, id, data)