[pkg-fso-commits] [SCM] framworkd debian packageing branch, master, updated. milestone2-89-geb27523

Guillaume Chereau (none) charlie at nikopol.
Sat Aug 23 14:06:18 UTC 2008


The following commit has been merged in the master branch:
commit a08e01b98cf5a8aeef94488877f56ab7a163a371
Author: Guillaume Chereau <charlie at nikopol.(none)>
Date:   Mon Aug 18 11:11:45 2008 +0800

    [oeventsd] Can connect to a DBus object signal before it has been created
    So that we don't need to call the Init method.
    Thanks to Mickey for the advice.

diff --git a/framework/subsystems/oeventsd/action.py b/framework/subsystems/oeventsd/action.py
index 08980e3..579e787 100644
--- a/framework/subsystems/oeventsd/action.py
+++ b/framework/subsystems/oeventsd/action.py
@@ -23,7 +23,7 @@ class Action(object):
 
 
 class DBusAction(Action):
-    """A spetial action that will call a DBus method"""
+    """A special action that will call a DBus method"""
     def __init__(self, bus, service, obj, interface, method, *args):
         super(DBusAction, self).__init__()
         self.bus = bus
diff --git a/framework/subsystems/oeventsd/oevents.py b/framework/subsystems/oeventsd/oevents.py
index 7296318..ab0483d 100644
--- a/framework/subsystems/oeventsd/oevents.py
+++ b/framework/subsystems/oeventsd/oevents.py
@@ -42,13 +42,7 @@ class EventsManager(dbus.service.Object):
 
     def add_rule(self, rule):
         self.rules.append(rule)
-
-    @dbus.service.method("org.freesmartphone.Events", in_signature='', out_signature='')
-    def Init(self):
-        """This method need to be called before the rules are actually effectives"""
-        logger.info("init all the rules")
-        for rule in self.rules:
-            rule.init()
+        rule.init()
 
 
 
diff --git a/framework/subsystems/oeventsd/trigger.py b/framework/subsystems/oeventsd/trigger.py
index c74bcd7..65920aa 100644
--- a/framework/subsystems/oeventsd/trigger.py
+++ b/framework/subsystems/oeventsd/trigger.py
@@ -66,10 +66,12 @@ class DBusTrigger(Trigger):
 
     def init(self):
         # Connect to the DBus signal
-        object = self.bus.get_object(self.service, self.obj)
-        iface = dbus.Interface(object, dbus_interface=self.interface)
         logger.info("connect trigger to dbus signal %s %s", self.obj, self.signal)
-        iface.connect_to_signal(self.signal, self.on_signal)
+        self.bus.add_signal_receiver(
+            self.on_signal,
+            dbus_interface=self.interface,
+            signal_name=self.signal
+        )
 
     def on_signal(self, *args):
         self(args=args)

-- 
framworkd debian packageing



More information about the pkg-fso-commits mailing list