--- /dev/null
+*.pyc
+*.pyo
--- /dev/null
+# -*- coding: utf-8 -*-
+from Converter import Converter
+from xml.dom.minidom import Document
+class EPGToText(Converter, object):
+
+ def __init__(self, type):
+ Converter.__init__(self, type)
+ print "Converter.EPGToText type=",type
+ self.type = type
+ def getHTML(self,value):
+ print "Converter.getHTML value=",value
+ return self.getText();
+ def getText(self):
+ if self.type == "search":
+ return self.EPGListToXML(self.source.searchEvent())
+ elif self.type == "service":
+ return self.EPGListToXML(self.source.getEPGofService())
+ elif self.type == "nownext":
+ return self.EPGListToXML(self.source.getEPGNowNext())
+ else:
+ return "unknown type ",type
+ def EPGListToXML(self,epglist):
+ if epglist :
+ xmlDocument = Document()
+ rootNode = xmlDocument.createElement('EPGList')
+ for row in epglist:
+ itemnode = xmlDocument.createElement('EPGEvent')
+ for key, val in row.items():
+ keynode = xmlDocument.createElement(key)
+ textnode = xmlDocument.createTextNode(val)
+ keynode.appendChild(textnode)
+ itemnode.appendChild(keynode);
+ rootNode.appendChild(itemnode)
+ xmlDocument.appendChild(rootNode)
+ return xmlDocument.toxml()
+ else:
+ return "no data"
+
+ text = property(getText,getHTML)
\ No newline at end of file
--- /dev/null
+from Converter import Converter
+from Components.config import *
+from enigma import eDVBVolumecontrol #this is not nice
+class VolumeToText(Converter, object):
+
+ def __init__(self, type):
+ Converter.__init__(self, type)
+ self.volctrl = eDVBVolumecontrol.getInstance() # this is not nice
+
+ def getHTML(self, id):
+ return self.getText() # encode & etc. here!
+ def getText(self):
+ r = "%s\n"%config.audio.volume.value
+ if self.volctrl.isMuted():
+ r+="muted"
+ else:
+ r+="notmuted"
+ return r
+
+
+ text = property(getText)
--- /dev/null
+from enigma import *
+
+from Source import Source
+from ServiceReference import ServiceReference
+
+class EPG( Source):
+ def __init__(self, navcore):
+ Source.__init__(self)
+ self.navcore = navcore
+ self.epgcache = eEPGCache.getInstance()
+ def handleCommand(self,cmd):
+ print "EPG.handleCommand %s" %cmd
+ self.command = cmd
+
+ def getEPGNowNext(self):
+ print "getting EPG of Service ",self.command
+ events = self.epgcache.lookupEvent(['IBDTSERN',(self.command,0,0,-1)]);
+ if events:
+ return self.convertToDictonary(events[:2])
+ else:
+ return False
+
+ def getEPGofService(self):
+ print "getting EPG of Service ",self.command
+ events = self.epgcache.lookupEvent(['IBDTSERN',(self.command,0,-1,-1)]);
+ if events:
+ return self.convertToDictonary(events)
+ else:
+ return False
+
+ def searchEvent(self):
+ print "searchEvent",self.command
+ events = self.epgcache.search(('IBDTSERN',1024,eEPGCache.PARTIAL_TITLE_SEARCH,self.command,1));
+ if events:
+ return self.convertToDictonary(events)
+ else:
+ return False
+ def convertToDictonary(self,EventList):
+ result=[]
+ for x in EventList:
+ row = {}
+ row['EventID']=self.convertIfEmpty(x[0])
+ row['TimeStart']=self.convertIfEmpty(x[1])
+ row['Duration']=self.convertIfEmpty(x[2])
+ row['Title']=self.convertIfEmpty(x[3])
+ row['Description']=self.convertIfEmpty(x[4])
+ row['DescriptionExtended']=self.convertIfEmpty(x[5])
+ row['ServiceReference']=self.convertIfEmpty(x[6])
+ row['ServiceName']=self.convertIfEmpty(x[7])
+ result.append(row)
+ return result
+ def convertIfEmpty(self,string):
+ if string == "":
+ return "N/A"
+ else:
+ return string.__str__()
+ epg = property(searchEvent,getEPGofService,getEPGNowNext)
\ No newline at end of file
--- /dev/null
+from Source import Source
+from GlobalActions import globalActionMap
+
+from time import time
+
+class Volume( Source):
+ def __init__(self, navcore):
+ Source.__init__(self)
+
+
+ def handleCommand(self, cmd):
+ global globalActionMap
+ if cmd == "up":
+ globalActionMap.actions["volumeUp"]()
+ elif cmd == "down":
+ globalActionMap.actions["volumeDown"]()
+ elif cmd == "mute":
+ globalActionMap.actions["volumeMute"]()
+ elif cmd == "value":
+ pass
+ else:
+ print "unknow Volume handle command",cmd
+
\ No newline at end of file
--- /dev/null
+<e2:screen name="TestScreen"><e2:element source="EPG" id="serviceRef"><e2:convert type="EPGToText">nownext</e2:convert></e2:element></e2:screen>
\ No newline at end of file
--- /dev/null
+<e2:screen name="TestScreen"><e2:element source="EPG" id="search"><e2:convert type="EPGToText">search</e2:convert></e2:element></e2:screen>
\ No newline at end of file
--- /dev/null
+<e2:screen name="TestScreen"><e2:element source="EPG" id="serviceRef"><e2:convert type="EPGToText">service</e2:convert></e2:element></e2:screen>
\ No newline at end of file
--- /dev/null
+<e2:screen name="TestScreen"><e2:element source="ServiceListBrowse">
+<e2:convert type="web:ListFiller"><e2:item name="Reference" />
+<e2:item name="Name"/>
+</e2:convert>
+ <e2:convert type="web:TextToHTML" />
+</e2:element>
+</e2:screen>
\ No newline at end of file
--- /dev/null
+<e2:screen name="TestScreen">
+<e2:element source="Volume" id="set">
+<e2:convert type="VolumeToText">CurrentVolume</e2:convert>
+</e2:element>
+</e2:screen>