1 from Components.Sources.Source import Source
2 from Components.config import config
4 class LocationsAndTags(Source):
9 def __init__(self, session, func):
12 self.session = session
13 self.result = False,"one two three four unknown command"
15 def handleCommand(self, cmd):
16 if self.func is self.CURRLOCATION:
17 self.result = [self.getCurrentLocation()]
18 elif self.func is self.LOCATIONS:
19 self.result = self.getLocations()
20 elif self.func is self.TAGS:
21 self.result = self.getTags()
25 def getCurrentLocation(self):
26 return config.movielist.last_videodir.value
28 def getLocations(self):
29 return config.movielist.videodirs.value
33 file = open("/etc/enigma2/movietags")
34 tags = [x.rstrip() for x in file.readlines()]
43 self.handleCommand(None)
46 xml = "<e2simplexmllist>\n"
48 for ele in self.result:
49 xml += "<e2simplexmlitem>%s</e2simplexmlitem>\n"%ele
50 xml += "</e2simplexmllist>\n"
53 text = property(getText)