Changed e-mail addy
[enigma2-plugins.git] / webinterface / src / WebComponents / Sources / PowerState.py
1 from Components.Sources.Source import Source
2
3 class PowerState(Source):
4         
5     def __init__(self,session):
6         self.cmd = []
7         self.session = session
8         Source.__init__(self)
9
10     def handleCommand(self, cmd):
11         self.cmd = cmd
12         print "PowerState:",self.cmd
13         if self.cmd == "" or self.cmd is None:
14             print "the PowerState was not defined (%s)" % self.cmd
15             return [[False,"the PowerState was not defined"]]
16         
17         # 1: poweroff/deepstandby
18         # 2: rebootdreambox
19         # 3: rebootenigma
20         # 4: standby
21         
22         type = int(self.cmd)
23         if type == 0:
24             print "Standby if"
25             from Screens.Standby import Standby
26             self.session.open(Standby)
27         elif type < 4:
28             print "TryQuitMainloop if"
29             from Screens.Standby import TryQuitMainloop
30             self.session.open(TryQuitMainloop, type)
31         else:
32             print "PowerState was not defined correctly (%s)" % type
33
34         #quitMainloop(type)