* Follow changes from tmbinc for string encoding
[enigma2-plugins.git] / webinterface / src / WebComponents / Sources / Timer.py
1 from enigma import *
2
3 from Components.Sources.Source import Source
4 from ServiceReference import ServiceReference
5 from enigma import eServiceReference 
6 class Timer( Source):
7     
8     def __init__(self, session):
9         #self.func = func
10         Source.__init__(self)        
11         self.session = session
12         self.recordtimer = session.nav.RecordTimer
13         
14 #    def handleCommand(self,cmd):
15 #        self.command = cmd
16
17     
18     def command(self):
19         timerlist = []
20         for item in self.recordtimer.timer_list+self.recordtimer.processed_timers:
21             timer = []
22             timer.append(item.service_ref)
23             timer.append(item.service_ref.getServiceName())
24             timer.append(item.eit)
25             timer.append(item.name)
26             timer.append(item.description)
27             timer.append(item.disabled)
28             timer.append(item.begin)
29             timer.append(item.end)
30             timer.append(item.end-item.begin)
31             timer.append(item.start_prepare)
32             timer.append(item.justplay)
33             timer.append(item.afterEvent)
34             timer.append(item.log_entries)
35             try: 
36                 timer.append(item.Filename)
37             except AttributeError:
38                 timer.append("")
39             
40             timer.append(item.backoff)       
41             try:
42                 timer.append(item.next_activation)
43             except AttributeError:
44                 timer.append("")
45             timer.append(item.first_try_prepare)  
46             timer.append(item.state)  
47             timer.append(item.repeated)
48             timer.append(item.dontSave)
49             timer.append(item.cancelled)
50             timerlist.append(timer) 
51             
52         return timerlist
53         
54     list = property(command)
55     lut = {"ServiceReference": 0
56            ,"ServiceName": 1
57            ,"EIT":2
58            ,"Name":3
59            ,"Description":4
60            ,"Disabled":5
61            ,"TimeBegin":6
62            ,"TimeEnd":7
63            ,"Duration":8
64            ,"startPrepare":9
65            ,"justPlay":10
66            ,"afterEvent":11
67            ,"LogEntries":12
68            ,"Filename":13
69            ,"Backoff":14
70            ,"nextActivation":15
71            ,"firstTryPrepare":16
72            ,"State":17
73            ,"Repeated":18
74            ,"dontSave":19
75            ,"Cancled":20
76            }
77