1 from Screen import Screen
2 from Components.config import *
3 from Components.ActionMap import NumberActionMap
4 from Components.ConfigList import ConfigList
5 from Components.NimManager import nimmanager
6 from Components.Label import Label
9 class TimerEntry(Screen):
10 def __init__(self, session):
11 Screen.__init__(self, session)
15 self["actions"] = NumberActionMap(["SetupActions"],
18 "cancel": self.keyCancel,
20 "right": self.keyRight,
21 "1": self.keyNumberGlobal,
22 "2": self.keyNumberGlobal,
23 "3": self.keyNumberGlobal,
24 "4": self.keyNumberGlobal,
25 "5": self.keyNumberGlobal,
26 "6": self.keyNumberGlobal,
27 "7": self.keyNumberGlobal,
28 "8": self.keyNumberGlobal,
29 "9": self.keyNumberGlobal,
30 "0": self.keyNumberGlobal
34 self["config"] = ConfigList(self.list)
37 self["introduction"] = Label("Press OK to start the scan")
39 def createConfig(self):
40 config.timerentry = ConfigSubsection()
42 config.timerentry.date = configElement_nonSave("config.timerentry.date", configDateTime, time(), ("%d.%B %Y", 86400))
43 config.timerentry.time = configElement_nonSave("config.timerentry.time", configDateTime, time(), ("%H:%M", 60))
45 def createSetup(self):
48 self.list.append(getConfigListEntry("Date", config.timerentry.date))
49 self.list.append(getConfigListEntry("Time", config.timerentry.time))
51 self["config"].list = self.list
52 self["config"].l.setList(self.list)
55 print self["config"].getCurrent()
56 if self["config"].getCurrent()[0] == "Type of scan":
58 if self["config"].getCurrent()[0] == "Tuner":
62 self["config"].handleKey(config.key["prevElement"])
66 self["config"].handleKey(config.key["nextElement"])
69 def keyNumberGlobal(self, number):
70 print "You pressed number " + str(number)
71 if (self["config"].getCurrent()[1].parent.enabled == True):
72 self["config"].handleKey(config.key[str(number)])
75 for x in self["config"].list:
77 self.session.openWithCallback(self.keyCancel, ServiceScan)
82 for x in self["config"].list: