fixes bug #436 2.8.0
authorStefan Pluecken <stefan.pluecken@multimedia-labs.de>
Wed, 31 Mar 2010 21:48:38 +0000 (23:48 +0200)
committerStefan Pluecken <stefan.pluecken@multimedia-labs.de>
Wed, 31 Mar 2010 21:53:38 +0000 (23:53 +0200)
write a magic 0 into /sys/module/dvb_core/parameters/dvb_shutdown_timeout before doing a service scan and restore the old value afterwards

lib/python/Screens/ServiceScan.py

index 6ee35b8..1fd32e0 100644 (file)
@@ -32,10 +32,25 @@ class ServiceScan(Screen):
        def ok(self):
                print "ok"
                if self["scan"].isDone():
+                       self.resetTimeout()
                        self.close()
        
        def cancel(self):
+               self.resetTimeout()
                self.close()
+               
+       def setTimeout(self):
+               try:
+                       self.oldtimeoutvalue = open("/sys/module/dvb_core/parameters/dvb_shutdown_timeout", "r").readline()
+                       open("/sys/module/dvb_core/parameters/dvb_shutdown_timeout", "w").write("0")
+               except:
+                       print "[info] no /sys/module/dvb_core/parameters/dvb_shutdown_timeout available"                
+               
+       def resetTimeout(self):
+               try:
+                       open("/sys/module/dvb_core/parameters/dvb_shutdown_timeout", "w").write(self.oldtimeoutvalue)
+               except:
+                       print "[info] no /sys/module/dvb_core/parameters/dvb_shutdown_timeout available"
        
        def __init__(self, session, scanList):
                Screen.__init__(self, session)
@@ -58,7 +73,9 @@ class ServiceScan(Screen):
                                "ok": self.ok,
                                "cancel": self.cancel
                        })
-                       
+               
+               self.setTimeout()
+               
                self.onFirstExecBegin.append(self.doServiceScan)
 
        def doServiceScan(self):