[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 95bdf8518f1f784400a9625abd2801c53917cd45
Author: Michael 'Mickey' Lauer <mickey at vanille-media.de>
Date:   Thu Jan 15 18:18:44 2009 +0100

    resource: on shutdown leave resources alone, if requested

diff --git a/framework/resource.py b/framework/resource.py
index 90fdfee..4b183a7 100644
--- a/framework/resource.py
+++ b/framework/resource.py
@@ -13,8 +13,9 @@ Module: resource
 """
 
 MODULE_NAME = "frameworkd.resource"
-__version__ = "0.3.1"
+__version__ = "0.3.2"
 
+from framework.config import config
 from framework.patterns import decorator
 
 import gobject
@@ -82,6 +83,8 @@ class Resource( dbus.service.Object ):
     """
     DBUS_INTERFACE = 'org.freesmartphone.Resource'
 
+    sync_resources_with_lifecycle = config.getValue( "ousaged", "sync_resources_with_lifecycle", "always" )
+
     def __init__( self, bus, name ):
         """
         Register the object as a new resource in ousaged
@@ -125,7 +128,9 @@ class Resource( dbus.service.Object ):
         """
         Called by the subsystem during system shutdown.
         """
-        if self._resourceStatus in "enabled enabling".split():
+
+        if self.sync_resources_with_lifecycle in ( "always", "shutdown" ) and \
+           self._resourceStatus in ( "enabled" , "enabling", "unknown" ):
             # no error handling, either it works or not
             #self._disable( lambda: None, lambda Foo: None )
             self.Disable( lambda: None, lambda Foo: None )
diff --git a/framework/subsystems/ousaged/resources.py b/framework/subsystems/ousaged/resources.py
index 28d7ce9..6e4fd23 100644
--- a/framework/subsystems/ousaged/resources.py
+++ b/framework/subsystems/ousaged/resources.py
@@ -201,7 +201,8 @@ class ODeviceDResource( AbstractResource ):
 #----------------------------------------------------------------------------#
 class ClientResource( AbstractResource ):
 #----------------------------------------------------------------------------#
-    """A resource that is controled by an external client.
+    """
+    A resource controlled by an external client.
 
     The client needs to expose a dbus object implementing org.freesmartphone.Resource.
     It can register using the RegisterResource of /org/freesmartphone/Usage.

-- 
FSO frameworkd Debian packaging



More information about the pkg-fso-commits mailing list