1 from enigma import eConsoleAppContainer, iServiceInformation, fbClass, eRCInput, eDBoxLCD, getDesktop
2 from Screens.Screen import Screen
3 from Plugins.Plugin import PluginDescriptor
4 from os import symlink, mkdir, remove, rmdir, path
6 class ShellStarter(Screen):
8 <screen position="1,1" size="1,1" title="TuxTXT" >
12 def __init__(self, session, args = None):
13 self.skin = ShellStarter.skin
14 Screen.__init__(self, session)
15 self.container=eConsoleAppContainer()
16 self.container.appClosed.append(self.finished)
20 service = self.session.nav.getCurrentService()
21 info = service and service.info()
22 txtpid = info and "%d" %(info.getInfo(iServiceInformation.sTXTPID)) or ""
24 stream = service and service.stream()
25 demux = stream and stream.getStreamingData()
26 demux = demux and demux.get("demux", -1)
27 demux = demux > -1 and "%d" %(demux) or ""
29 eDBoxLCD.getInstance().lock()
30 eRCInput.getInstance().lock()
31 fbClass.getInstance().lock()
33 self.faked_lcd = not path.exists("/dev/dbox")
36 symlink("/dev/null", "/dev/dbox/lcd0")
38 if self.container.execute("/usr/bin/tuxtxt " + demux + " " + txtpid):
41 def finished(self,retval):
42 fbClass.getInstance().unlock()
43 eRCInput.getInstance().unlock()
44 eDBoxLCD.getInstance().unlock()
47 remove("/dev/dbox/lcd0")
52 dsk.resize(dsk.size())
56 def main(session, **kwargs):
57 session.open(ShellStarter)
59 def Plugins(**kwargs):
60 return PluginDescriptor(name="TuxTXT", description="Videotext", where = PluginDescriptor.WHERE_TELETEXT, fnc=main)