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


The following commit has been merged in the master branch:
commit a56d8472731576a9a6b2dcbc786ef263c2f39c2c
Author: Michael 'Mickey' Lauer <mickey at vanille-media.de>
Date:   Wed Nov 19 15:50:11 2008 +0100

    testing: add new subsystem solely for testing purposes

diff --git a/framework/patterns/__init__.py b/framework/subsystems/testing/__init__.py
similarity index 100%
copy from framework/patterns/__init__.py
copy to framework/subsystems/testing/__init__.py
diff --git a/framework/subsystems/testing/testing.py b/framework/subsystems/testing/testing.py
new file mode 100644
index 0000000..4e4f65d
--- /dev/null
+++ b/framework/subsystems/testing/testing.py
@@ -0,0 +1,66 @@
+#!/usr/bin/env python
+"""
+Dummy Subsystem for Testing Purposes
+
+(C) 2008 Michael 'Mickey' Lauer <mlauer at vanille-media.de>
+(C) 2008 Openmoko, Inc.
+GPLv2 or later
+
+Package: testing
+Module: testing
+"""
+
+MODULE_NAME = "testing"
+__version__ = "0.0.0"
+
+from framework import resource
+
+import dbus
+import dbus.service
+import gobject
+
+import logging
+logger = logging.getLogger( MODULE_NAME )
+
+DBUS_INTERFACE_NETWORK = "org.freesmartphone.Testing"
+DBUS_OBJECT_PATH = "/org/freesmartphone/Testing"
+
+#============================================================================#
+class Resource( resource.Resource ):
+#============================================================================#
+    def __init__( self, bus ):
+        self.path = DBUS_OBJECT_PATH
+        self.bus = bus
+        dbus.service.Object.__init__( self, bus, self.path )
+        resource.Resource.__init__( self, bus, "TEST" )
+        logger.info("%s %s at %s initialized.", self.__class__.__name__, __version__, self.path )
+    #
+    # framework.Resource
+    #
+    def _enable( self, on_ok, on_error ):
+        logger.info( "enabling" )
+        on_ok()
+
+    def _disable( self, on_ok, on_error ):
+        logger.info( "disabling" )
+        on_ok()
+
+    def _suspend( self, on_ok, on_error ):
+        logger.info( "suspending" )
+        on_ok()
+
+    def _resume( self, on_ok, on_error ):
+        logger.info("resuming")
+        on_ok()
+
+#============================================================================#
+def factory(prefix, controller):
+#============================================================================#
+    """This is the magic function that will be called by the framework module manager"""
+    return [ Resource( controller.bus ) ]
+
+#============================================================================#
+if __name__ == "__main__":
+#============================================================================#
+    pass
+

-- 
FSO frameworkd Debian packaging



More information about the pkg-fso-commits mailing list