Update German translation
[enigma2-plugins.git] / kiddytimer / src / KTglob.py
1 import time
2
3 PLUGIN_BASE = "KiddyTimer"
4 PLUGIN_VERSION = "0.7"
5
6 DAYNAMES= (_("Sunday"),
7           _("Monday"),
8           _("Tuesday"),
9           _("Wednesday"),
10           _("Thursday"),
11           _("Friday"),
12           _("Saturday"),
13           )
14
15 ONEHOUR=3600
16 ONEMINUTE=60
17
18 MOVEPOSITIONSTEP = 10
19
20
21 #This is a hack to get the times in the current timezone to feed as default value for the ConfigClock
22 ONEOCLOCK=time.mktime([2000,1,1,1,0,0,5,1,time.timezone])
23 EIGHTOCLOCK=time.mktime([2000,1,1,8,0,0,5,1,time.timezone])
24 EIGHTOCLOCKNOON=time.mktime([2000,1,1,20,0,0,5,1,time.timezone])
25
26 plugin_path = ""
27
28 ##############################################################################
29
30 SKIN = """
31     <screen flags="wfNoBorder" position="0,0" size="82,104" title="Kiddy Timer" backgroundColor="#ff000000">
32         <ePixmap pixmap="~/img/Smiley-Background.png" position="0,0" zPosition="1" size="82,82" alphatest="blend" transparent="1"/>
33         <widget name="TimerSlider" pixmap="~/img/Smiley-Slider.png" zPosition="2" position="0,0" size="82,82" transparent="1" orientation="orBottomToTop" />
34         <widget name="TimerSliderText" zPosition="3" position="0,83" size="82,21" font="Regular;18" halign="center" valign="center" foregroundColor="#000000" backgroundColor="#aaffffff" />
35         <widget name="TimerGraph" pixmaps="~/img/Timer1000.png,~/img/Timer0950.png,~/img/Timer0900.png,~/img/Timer0850.png,~/img/Timer0800.png,~/img/Timer0750.png,~/img/Timer0700.png,~/img/Timer0650.png,~/img/Timer0600.png,~/img/Timer0550.png,~/img/Timer0500.png,~/img/Timer0450.png,~/img/Timer0400.png,~/img/Timer0350.png,~/img/Timer0300.png,~/img/Timer0250.png,~/img/Timer0200.png,~/img/Timer0150.png,~/img/Timer0100.png,~/img/Timer0050.png,~/img/Timer0000.png" position="0,0" zPosition="2" size="82,82" transparent="1" alphatest="on" />
36         <widget name="TimerText" zPosition="3" position="0,30" size="82,21" font="Regular;18" halign="center" valign="center" foregroundColor="#000000" transparent = "1" />
37     </screen>"""
38
39 ##############################################################################
40
41 def getSecondsFromClock(aClock):
42     iSeconds = 60*(int(aClock[0])*60 + int(aClock[1]))
43     return iSeconds
44
45 def getTimeFromSeconds(iSecondsLeft,bReturnSeconds):
46         iHours = int( iSecondsLeft // 3600 )
47         iHourRest = iSecondsLeft - ( iHours * 3600 )
48         iMinutes = int( iHourRest // 60 )
49         if bReturnSeconds == False:
50             return( ("00"+str(iHours))[-2:] + ":" + ("00"+str(iMinutes))[-2:] )
51         else:
52             iSeconds = int( iHourRest - ( iMinutes * 60) )
53             return( ("00"+str(iHours))[-2:] + ":" + ("00"+str(iMinutes))[-2:] + ":" + ("00"+str(iSeconds))[-2:] )
54
55