aboutsummaryrefslogtreecommitdiff
path: root/lib/python
diff options
context:
space:
mode:
authorStefan Pluecken <stefan.pluecken@multimedia-labs.de>2005-11-12 23:39:22 +0000
committerStefan Pluecken <stefan.pluecken@multimedia-labs.de>2005-11-12 23:39:22 +0000
commit5c27251fa08566a00d124aaf2c02249995dac9cf (patch)
tree1ba27991ef0e0e02af1884b13fa874f5d583c4d7 /lib/python
parent47c79edd46ef8d5cf7da20dd4e376d70c55b6243 (diff)
downloadenigma2-5c27251fa08566a00d124aaf2c02249995dac9cf.tar.gz
enigma2-5c27251fa08566a00d124aaf2c02249995dac9cf.zip
add starttimes to infobar
Diffstat (limited to 'lib/python')
-rw-r--r--lib/python/Components/EventInfo.py16
-rw-r--r--lib/python/Screens/InfoBar.py3
2 files changed, 14 insertions, 5 deletions
diff --git a/lib/python/Components/EventInfo.py b/lib/python/Components/EventInfo.py
index c8e5a13f..6f6d07ff 100644
--- a/lib/python/Components/EventInfo.py
+++ b/lib/python/Components/EventInfo.py
@@ -1,4 +1,6 @@
from PerServiceDisplay import *
+from time import strftime
+from time import localtime
from enigma import iServiceInformationPtr, eServiceEventPtr
@@ -7,6 +9,8 @@ class EventInfo(PerServiceDisplay):
Next = 1
Now_Duration = 2
Next_Duration = 3
+ Now_StartTime = 4
+ Next_StartTime = 5
def __init__(self, navcore, now_or_next):
# listen to evUpdatedEventInfo and evStopService
@@ -27,12 +31,14 @@ class EventInfo(PerServiceDisplay):
if info is not None:
ev = info.getEvent(self.now_or_next & 1)
if ev is not None:
- if self.now_or_next & 2:
- self.setText("%d min" % (ev.m_duration / 60))
- else:
- self.setText(ev.m_event_name)
+ if (self.Now_Duration <= self.now_or_next <= self.Next_Duration):
+ self.setText("%d min" % (ev.getDuration() / 60))
+ if (self.Now_StartTime <= self.now_or_next <= self.Next_StartTime):
+ self.setText(strftime("%H:%M", localtime(ev.getBeginTime())))
+ if (self.Now <= self.now_or_next <= self.Next):
+ self.setText(ev.getEventName())
def stopEvent(self):
self.setText(
- ("waiting for event data...", "", "--:--", "--:--")[self.now_or_next]);
+ ("waiting for event data...", "", "--:--", "--:--", "--:--", "--:--")[self.now_or_next]);
diff --git a/lib/python/Screens/InfoBar.py b/lib/python/Screens/InfoBar.py
index 46ba24b1..62639c04 100644
--- a/lib/python/Screens/InfoBar.py
+++ b/lib/python/Screens/InfoBar.py
@@ -131,6 +131,9 @@ class InfoBar(Screen):
self["ServiceName"] = ServiceName(self.session.nav)
+ self["Event_Now_StartTime"] = EventInfo(self.session.nav, EventInfo.Now_StartTime)
+ self["Event_Next_StartTime"] = EventInfo(self.session.nav, EventInfo.Next_StartTime)
+
self["Event_Now"] = EventInfo(self.session.nav, EventInfo.Now)
self["Event_Next"] = EventInfo(self.session.nav, EventInfo.Next)