[pkg-fso-commits] [SCM] FSO frameworkd Debian packaging branch, master, updated. milestone4-368-g700ab82

Julien 'Ainulindale' Cassignol ainulindale at gmail.com
Mon Feb 2 18:51:19 UTC 2009


The following commit has been merged in the master branch:
commit 5e6f7a5a63379f13183cd544f9d88587119d7eb0
Author: Julien 'Ainulindale' Cassignol <ainulindale at gmail.com>
Date:   Wed Nov 19 14:27:04 2008 +0100

    oeventsd/ExternalDBusAction : proper handling of the bus argument.

diff --git a/framework/subsystems/oeventsd/fso_actions.py b/framework/subsystems/oeventsd/fso_actions.py
index 0a31065..13324b9 100644
--- a/framework/subsystems/oeventsd/fso_actions.py
+++ b/framework/subsystems/oeventsd/fso_actions.py
@@ -302,14 +302,34 @@ class ExternalDBusAction(DBusAction):
     A dbus action on the freesmartphone audio device
     """
     def __init__(self, bus, service, obj, interface, method, *args):
-        dbusBus = None
-        self.bus = bus
-        if bus == "system":
-                dbusBus = dbus.SystemBus()
-        else:
-                dbusBus = dbus.SessionBus()
-        logger.info(str(args))
-        super(ExternalDBusAction, self).__init__(dbusBus, service, obj, interface, method, *args)
+        """Create the DBus action
+
+        arguments:
+        - bus       the DBus bus name (or a string : 'system' | 'session')
+        - service   the DBus name of the service
+        - obj       the DBus path of the object
+        - interface the Dbus interface of the signal
+        - method    the DBus name of the method
+        - args      the arguments for the method
+
+        """
+        # some arguments checking
+        if isinstance(bus, str):
+            if bus == 'system':
+                bus = dbus.SystemBus()
+            elif bus == 'session':
+                bus = dbus.SessionBus()
+            else:
+                raise TypeError("Bad dbus bus : %s" % bus)
+        if not obj:
+            obj = None
+
+        assert isinstance(service, str), "service is not str"
+        assert obj is None or isinstance(obj, str), "obj is not str or None"
+        assert isinstance(interface, str), "interface is not str"
+        assert isinstance(signal, str), "signal is not str"
+        
+        super(ExternalDBusAction, self).__init__(bus, service, obj, interface, method, *args)
 
     def __repr__( self ):
         return "ExternalDBusAction(bus = %s, service = %s, obj = %s, itf = %s, method = %s)" % (self.bus, self.service, self.obj, self.interface, self.method)

-- 
FSO frameworkd Debian packaging



More information about the pkg-fso-commits mailing list