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

Michael 'Mickey' Lauer mickey at vanille-media.de
Mon Feb 2 18:51:49 UTC 2009


The following commit has been merged in the master branch:
commit d9d411876307c59de8c4a631656eb5c04dae824c
Author: Michael 'Mickey' Lauer <mickey at vanille-media.de>
Date:   Fri Jan 2 16:59:26 2009 +0100

    oeventsd: Add an OccupyResource action plus some corresponding rules.
    NOTE: See rules file for one testing rule which is still outcommented.

diff --git a/ChangeLog b/ChangeLog
index 604aabf..c3818c0 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+2009-01-02	Michael Lauer	<mlauer at vanille-media.de>
+
+	* Removed ListObjectsByInterface from frameworkd objectquery.py. This will
+	  now be implemented by dbus-hlid (a seperate FSO project).
+	* [oeventsd] Added OccupyResource action and add some convenient rules.
+
 2008-12-30	Michael Lauer	<mickey at openmoko.org>
 
 	* [odeviced] Register objects under /org/freesmartphone/Device/Display/ also
diff --git a/etc/freesmartphone/oevents/rules.yaml b/etc/freesmartphone/oevents/rules.yaml
index df8e010..f82114f 100644
--- a/etc/freesmartphone/oevents/rules.yaml
+++ b/etc/freesmartphone/oevents/rules.yaml
@@ -1,5 +1,5 @@
 
-# This file is in YAML format (http://www.yaml.org/) 
+# This file is in YAML format (http://www.yaml.org/)
 # We define a list of rules that will be automatically loaded
 # When we start the oevents module of the framework daemon
 #
@@ -9,7 +9,7 @@
 # - actions     : action object or list of actions objects
 #
 # We define the following functions :
-# - CallStatus()            : create a trigger object activated on a call status event 
+# - CallStatus()            : create a trigger object activated on a call status event
 # - PowerStatus()           : create a trigger object activated on a power status event
 # - HasAttr(name, value)    : create a filter that accept signal with a given attribute
 # - Not(filter)             : create a neg filter
@@ -47,14 +47,24 @@
     actions:
              - RingTone()
              - SetDisplayBrightness("0", 90)
+             - OccupyResource(CPU)
+
 -
     while: CallStatus()
     filters: Or(HasAttr(status, "outgoing"), HasAttr(status, "active"))
-    actions: SetScenario(gsmhandset)
+    actions:
+            - SetScenario(gsmhandset)
+            - OccupyResource(CPU)
 -
     while: PowerStatus()
     filters: HasAttr(status, "charging")
     actions: SetLed("gta02_power_orange", "light")
+
+#-
+#    while: PowerStatus()
+#    filters: Not(HasAttr(status, "discharging"))
+#    actions: OccupyResource(Display)
+
 -
     while: PowerStatus()
     filters: HasAttr(status, "critical")
@@ -104,7 +114,7 @@
 -
     trigger: DbusTrigger(system, 'org.freesmartphone.odeviced', 0, 'org.freesmartphone.Device.IdleNotifier', 'State')
     actions: Debug("dbus trigger test")
-- 
+-
 
     #
     # Idleness Brightness Handling
diff --git a/framework/subsystems/oeventsd/fso_actions.py b/framework/subsystems/oeventsd/fso_actions.py
index 3b1c2d6..1171286 100644
--- a/framework/subsystems/oeventsd/fso_actions.py
+++ b/framework/subsystems/oeventsd/fso_actions.py
@@ -13,7 +13,7 @@ Module: fso_actions
 
 """
 
-__VERSION__ = "0.3.0"
+__VERSION__ = "0.4.0"
 MODULE_NAME = "oeventsd"
 
 import framework.patterns.tasklet as tasklet
@@ -166,6 +166,28 @@ class VibratorAction(Action):
                     'org.freesmartphone.Device.LED',
                     'SetBrightness', 0).trigger()
 
+#============================================================================#
+class OccupyResourceAction(Action):
+#============================================================================#
+    function_name = 'OccupyResource'
+
+    def __init__(self, resource):
+        self.resource = resource
+
+    def trigger(self, **kargs):
+        DBusAction(dbus.SystemBus(),
+                    'org.freesmartphone.ousaged',
+                    '/org/freesmartphone/Usage',
+                    'org.freesmartphone.Usage',
+                    'RequestResource', self.resource).trigger()
+
+    def untrigger(self, **kargs):
+        DBusAction(dbus.SystemBus(),
+                    'org.freesmartphone.ousaged',
+                    '/org/freesmartphone/Usage',
+                    'org.freesmartphone.Usage',
+                    'ReleaseResource', self.resource).trigger()
+
 #=========================================================================#
 class RingToneAction(Action):
 #=========================================================================#

-- 
FSO frameworkd Debian packaging



More information about the pkg-fso-commits mailing list