[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:57 UTC 2009


The following commit has been merged in the master branch:
commit 5646c67fd1c4de312e16d92fe0e45f7147d03f4d
Author: Michael 'Mickey' Lauer <mickey at vanille-media.de>
Date:   Thu Jan 15 18:17:06 2009 +0100

    ousaged: Add config option 'sync_resources_with_lifecycle' for specifying whether all
    Resources should be disabled on "startup", "shutdown", "always" (default), or "never".

diff --git a/ChangeLog b/ChangeLog
index cfa5566..4a3cfaa 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -2,6 +2,8 @@
 
 	* [oeventsd] Serialize dbus requests with a Queue. This (and removing a race in the RingToneAction)
 	should fix the problems with neverending vibration and audio ringtone on short calls (FSO ticket #205)
+	* [ousaged] Add config option 'sync_resources_with_lifecycle' for specifying whether all Resources should
+	be disabled on "startup", "shutdown", "always" (default), or "never".
 
 2009-01-14	Michael Lauer	<mlauer at vanille-media.de>
 
diff --git a/conf/example/frameworkd.conf b/conf/example/frameworkd.conf
index ba62b89..6541c75 100644
--- a/conf/example/frameworkd.conf
+++ b/conf/example/frameworkd.conf
@@ -57,9 +57,9 @@ disable = 0
 
 [ogsmd]
 disable = 0
-# chose your modem type, available types are: ti_calypso, freescale_neptune, singleline, muxed4line, option, ...
+# choose your modem type, available types are: ti_calypso, freescale_neptune, singleline, muxed4line, option, ...
 modemtype = ti_calypso
-# if you have a ti_calypso, you can chose the deep sleep mode. Valid values are: never, adaptive (default), always
+# if you have a ti_calypso, you can choose the deep sleep mode. Valid values are: never, adaptive (default), always
 ti_calypso_deep_sleep = adaptive
 # if you have a ti_calypso, you can choose the dsp mode for audio enhancement. Valid values are:
 #    "short-aec": Short Echo Cancellation (max)
@@ -85,6 +85,10 @@ channel = SerialChannel
 path = /dev/ttySAC1
 log_level = INFO
 
+[ousaged]
+# choose whether resources should be disabled at startup, at shutdown, always (default), or never.
+sync_resources_with_lifecycle = always
+
 [opreferencesd]
 log_level = DEBUG
 disable = 0
diff --git a/framework/subsystems/ousaged/resources.py b/framework/subsystems/ousaged/resources.py
index 87cd589..28d7ce9 100644
--- a/framework/subsystems/ousaged/resources.py
+++ b/framework/subsystems/ousaged/resources.py
@@ -15,7 +15,8 @@ Module: resources
 MODULE_NAME = "ousaged"
 __version__ = "0.6.1"
 
-import framework.patterns.tasklet as tasklet
+from framework.config import config
+from framework.patterns import tasklet
 
 import gobject
 import dbus
@@ -206,6 +207,8 @@ class ClientResource( AbstractResource ):
     It can register using the RegisterResource of /org/freesmartphone/Usage.
     If the client is written in python, it can use the framework.Resource class.
     """
+    sync_resources_with_lifecycle = config.getValue( "ousaged", "sync_resources_with_lifecycle", "always" )
+
     def __init__( self, usageControl, name, path, sender ):
         """
         Create a new ClientResource
@@ -217,6 +220,9 @@ class ClientResource( AbstractResource ):
         proxy = bus.get_object( sender, path )
         self.iface = dbus.Interface( proxy, "org.freesmartphone.Resource" )
 
+        if self.sync_resources_with_lifecycle in ( "always", "startup" ):
+            self._disable().start()
+
     @tasklet.tasklet
     def _enable( self ):
         """Simply call the client Enable method"""

-- 
FSO frameworkd Debian packaging



More information about the pkg-fso-commits mailing list