1 from Screen import Screen
2 from Components.ActionMap import NumberActionMap
3 from Components.Input import Input
5 class MinuteInput(Screen):
6 def __init__(self, session, basemins = 5):
7 Screen.__init__(self, session)
9 self["minutes"] = Input(str(basemins), type=Input.NUMBER)
11 self["actions"] = NumberActionMap([ "InputActions" , "MinuteInputActions", "TextEntryActions", "KeyboardInputActions" ],
13 "1": self.keyNumberGlobal,
14 "2": self.keyNumberGlobal,
15 "3": self.keyNumberGlobal,
16 "4": self.keyNumberGlobal,
17 "5": self.keyNumberGlobal,
18 "6": self.keyNumberGlobal,
19 "7": self.keyNumberGlobal,
20 "8": self.keyNumberGlobal,
21 "9": self.keyNumberGlobal,
22 "0": self.keyNumberGlobal,
27 "deleteForward": self.deleteForward,
28 "deleteBackward": self.deleteBackward,
35 def keyNumberGlobal(self, number):
36 self["minutes"].number(number)
40 self["minutes"].left()
43 self["minutes"].right()
46 self["minutes"].home()
51 def deleteForward(self):
52 self["minutes"].delete()
54 def deleteBackward(self):
55 self["minutes"].deleteBackward()
61 self["minutes"].down()
64 self.close(int(self["minutes"].getText()))