use twisted reactor when available
authorFelix Domke <tmbinc@elitedvb.net>
Fri, 13 Jan 2006 02:04:45 +0000 (02:04 +0000)
committerFelix Domke <tmbinc@elitedvb.net>
Fri, 13 Jan 2006 02:04:45 +0000 (02:04 +0000)
mytest.py

index 6a96470..a9c8197 100644 (file)
--- a/mytest.py
+++ b/mytest.py
@@ -19,6 +19,19 @@ from Components.config import configfile
 from Tools.Directories import InitFallbackFiles
 InitFallbackFiles()
 eDVBDB.getInstance().reloadBouquets()
 from Tools.Directories import InitFallbackFiles
 InitFallbackFiles()
 eDVBDB.getInstance().reloadBouquets()
+
+try:
+       from twisted.internet import e2reactor
+       e2reactor.install()
+       
+       from twisted.internet import reactor
+       
+       def runReactor():
+               reactor.run()
+except:
+       def runReactor():
+               runMainloop()
+
 # initialize autorun plugins and plugin menu entries
 from Components.PluginComponent import plugins
 plugins.getPluginList(runAutostartPlugins=True)
 # initialize autorun plugins and plugin menu entries
 from Components.PluginComponent import plugins
 plugins.getPluginList(runAutostartPlugins=True)
@@ -204,7 +217,7 @@ def runScreenTest():
 
        CONNECT(keyPressedSignal(), session.keyEvent)
        
 
        CONNECT(keyPressedSignal(), session.keyEvent)
        
-       runMainloop()
+       runReactor()
        
        configfile.save()
        
        
        configfile.save()