use twochar mapping on upc direct transponder tsid 0x407 nid 1
[enigma2.git] / mytest.py
index 8ea13e0a5e59468b7f3dea678d243a04851bcc3c..15f3b7dbfb487bfb5a2a6667fe88e17ba0232564 100644 (file)
--- a/mytest.py
+++ b/mytest.py
@@ -19,21 +19,27 @@ import time
 
 import ServiceReference
 
+from Components.ParentalControl import InitParentalControl
+InitParentalControl()
+
 from Navigation import Navigation
 
 from skin import readSkin, applyAllAttributes
 
 from Tools.Directories import InitFallbackFiles, resolveFilename, SCOPE_PLUGINS, SCOPE_SKIN_IMAGE
-from Components.config import configfile, configElement, configText, ConfigSubsection, config, configSequence, configsequencearg
+from Components.config import config, ConfigText, configfile, ConfigSubsection, ConfigInteger
 InitFallbackFiles()
 eDVBDB.getInstance().reloadBouquets()
 
-config.misc.radiopic = configElement("config.misc.radiopic", configText, resolveFilename(SCOPE_SKIN_IMAGE)+"radio.mvi", 0)
+config.misc.radiopic = ConfigText(default = resolveFilename(SCOPE_SKIN_IMAGE)+"radio.mvi")
 
 try:
        import e2reactor
        e2reactor.install()
        
+       import twisted.python.runtime
+       twisted.python.runtime.platform.supportsThreads = lambda: False
+       
        from twisted.internet import reactor
        
        def runReactor():
@@ -193,6 +199,10 @@ class Session:
        def instantiateDialog(self, screen, *arguments, **kwargs):
                return self.doInstantiateDialog(screen, arguments, kwargs, self.desktop)
        
+       def deleteDialog(self, screen):
+               screen.hide()
+               screen.doClose()
+       
        def instantiateSummaryDialog(self, screen, *arguments, **kwargs):
                return self.doInstantiateDialog(screen, arguments, kwargs, self.summary_desktop)
        
@@ -316,7 +326,7 @@ class VolumeControl:
                globalActionMap.actions["volumeMute"]=self.volMute
 
                config.audio = ConfigSubsection()
-               config.audio.volume = configElement("config.audio.volume", configSequence, [100], configsequencearg.get("INTEGER", (0, 100)))
+               config.audio.volume = ConfigInteger(default = 100, limits = (0, 100))
 
                self.volumeDialog = session.instantiateDialog(Volume)
                self.muteDialog = session.instantiateDialog(Mute)
@@ -324,7 +334,8 @@ class VolumeControl:
                self.hideVolTimer = eTimer()
                self.hideVolTimer.timeout.get().append(self.volHide)
 
-               vol = config.audio.volume.value[0]
+               vol = config.audio.volume.value
+               print "volume is", vol
                self.volumeDialog.setValue(vol)
                eDVBVolumecontrol.getInstance().setVolume(vol, vol)
 
@@ -450,6 +461,7 @@ def runScreenTest():
                else:
                        setFPWakeuptime(nextRecordingTime - (300))
        
+       session.nav.stopService()
        session.nav.shutdown()
        
        return 0
@@ -493,6 +505,9 @@ try:
        runScreenTest()
 
        plugins.shutdown()
+       
+       from Components.ParentalControl import parentalControl
+       parentalControl.save()
 except:
        print 'EXCEPTION IN PYTHON STARTUP CODE:'
        print '-'*60