git.cweiske.de
/
enigma2.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
fix frequently segfault on clean shutdown
[enigma2.git]
/
lib
/
python
/
Components
/
Sources
/
ServiceEvent.py
diff --git
a/lib/python/Components/Sources/ServiceEvent.py
b/lib/python/Components/Sources/ServiceEvent.py
index 95c9140b2b3b022580b9e762eba6739151e862c4..93c733bd1c5bc044acbf069f2a86b50da6908bc1 100644
(file)
--- a/
lib/python/Components/Sources/ServiceEvent.py
+++ b/
lib/python/Components/Sources/ServiceEvent.py
@@
-1,30
+1,30
@@
-from Components.VariableText import VariableText
from Components.Element import cached
from Components.Element import cached
-from Components.GUIComponent import GUIComponent
-from enigma import eEPGCache, eServiceReference as Ref, eLabel
+from enigma import eServiceCenter, eServiceReference as Ref
from Source import Source
from Source import Source
-class ServiceEvent(
VariableText, GUIComponent,
Source, object):
+class ServiceEvent(Source, object):
def __init__(self):
Source.__init__(self)
def __init__(self):
Source.__init__(self)
- GUIComponent.__init__(self)
- VariableText.__init__(self)
- self.cur_ref = None
+ self.service = None
- GUI_WIDGET = eLabel
+ @cached
+ def getCurrentService(self):
+ return self.service
-#TODO Add a timer to get every minute the actual event..
-#but this just make sense when the Servicelist do the same thing..
@cached
def getCurrentEvent(self):
@cached
def getCurrentEvent(self):
- epg = eEPGCache.getInstance()
- return epg and self.cur_ref and epg.startTimeQuery(self.cur_ref) != -1 and epg.getNextTimeEntry() or None
+ return self.service and self.info and self.info.getEvent(self.service)
+
+ @cached
+ def getInfo(self):
+ return self.service and eServiceCenter.getInstance().info(self.service)
event = property(getCurrentEvent)
event = property(getCurrentEvent)
+ info = property(getInfo)
def newService(self, ref):
def newService(self, ref):
- if not self.
cur_ref or self.cur_ref
!= ref:
- self.
cur_ref
= ref
+ if not self.
service or not ref or self.service
!= ref:
+ self.
service
= ref
if not ref or (ref.flags & Ref.flagDirectory) == Ref.flagDirectory or ref.flags & Ref.isMarker:
self.changed((self.CHANGED_CLEAR,))
else:
if not ref or (ref.flags & Ref.flagDirectory) == Ref.flagDirectory or ref.flags & Ref.isMarker:
self.changed((self.CHANGED_CLEAR,))
else: