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

Daniel Willmann daniel at totalueberwachung.de
Mon Feb 2 18:52:04 UTC 2009


The following commit has been merged in the master branch:
commit 70a3c2b1128e8a5293aced1dd14f80b5d6ee658d
Author: Michael 'Mickey' Lauer <mickey at vanille-media.de>
Date:   Wed Jan 21 13:40:42 2009 +0100

    ogpsd: Check in all resource functions if a channel is None and warn
    
    Under certain circumstances, i.e. with testdevices we don't have a
    channel. Also remove stray shutdownChannel from commit
    0be860bbc94f497a877555fbb4c9c95107634ef3

diff --git a/framework/subsystems/ogpsd/gpsdevice.py b/framework/subsystems/ogpsd/gpsdevice.py
index b0362a0..05564a0 100644
--- a/framework/subsystems/ogpsd/gpsdevice.py
+++ b/framework/subsystems/ogpsd/gpsdevice.py
@@ -65,7 +65,10 @@ class GPSDevice( resource.Resource ):
     #
     def _enable( self, on_ok, on_error ):
         logger.info( "enabling" )
-        self.channel.initializeChannel()
+        if self.channel is not None:
+            self.channel.initializeChannel()
+        else:
+            logger.warn("GPSDevice has no channel assigned")
         self.initializeDevice()
         self.ConnectionStatusChanged( True )
         on_ok()
@@ -76,19 +79,26 @@ class GPSDevice( resource.Resource ):
         self.shutdownDevice()
         if self.channel is not None:
             self.channel.shutdownChannel()
+        else:
+            logger.warn("GPSDevice has no channel assigned")
         on_ok()
 
     def _suspend( self, on_ok, on_error ):
         logger.info( "suspending" )
         self.ConnectionStatusChanged( False )
         self.suspendDevice()
-        self.channel.shutdownChannel()
-        self.channel.suspendChannel()
+        if self.channel is not None:
+            self.channel.suspendChannel()
+        else:
+            logger.warn("GPSDevice has no channel assigned")
         on_ok()
 
     def _resume( self, on_ok, on_error ):
         logger.info("resuming")
-        self.channel.resumeChannel()
+        if self.channel is not None:
+            self.channel.resumeChannel()
+        else:
+            logger.warn("GPSDevice has no channel assigned")
         self.resumeDevice()
         self.ConnectionStatusChanged( True )
         on_ok()

-- 
FSO frameworkd Debian packaging



More information about the pkg-fso-commits mailing list