diff options
Diffstat (limited to 'lib/python')
| -rw-r--r-- | lib/python/Screens/Globals.py | 7 | ||||
| -rw-r--r-- | lib/python/Screens/Screen.py | 15 | ||||
| -rw-r--r-- | lib/python/Screens/SessionGlobals.py | 14 |
3 files changed, 35 insertions, 1 deletions
diff --git a/lib/python/Screens/Globals.py b/lib/python/Screens/Globals.py new file mode 100644 index 00000000..9ae10026 --- /dev/null +++ b/lib/python/Screens/Globals.py @@ -0,0 +1,7 @@ +from Screens.Screen import Screen +from Components.Sources.Clock import Clock + +class Globals(Screen): + def __init__(self): + Screen.__init__(self, None) + self["CurrentTime"] = Clock() diff --git a/lib/python/Screens/Screen.py b/lib/python/Screens/Screen.py index ed61d9d6..4e3b117e 100644 --- a/lib/python/Screens/Screen.py +++ b/lib/python/Screens/Screen.py @@ -7,9 +7,12 @@ class Screen(dict, HTMLSkin, GUISkin): ALLOW_SUSPEND = False - def __init__(self, session): + global_scren = None + + def __init__(self, session, parent = None): self.skinName = self.__class__.__name__ self.session = session + self.parent = parent GUISkin.__init__(self) self.onClose = [ ] @@ -140,3 +143,13 @@ class Screen(dict, HTMLSkin, GUISkin): def __repr__(self): return str(type(self)) + + def getRelatedScreen(self, name): + if name == "session": + return self.session.screen + elif name == "parent": + return self.parent + elif name == "global": + return self.global_screen + else: + return None diff --git a/lib/python/Screens/SessionGlobals.py b/lib/python/Screens/SessionGlobals.py new file mode 100644 index 00000000..d90c2080 --- /dev/null +++ b/lib/python/Screens/SessionGlobals.py @@ -0,0 +1,14 @@ +from Screens.Screen import Screen +from Components.Sources.CurrentService import CurrentService +from Components.Sources.EventInfo import EventInfo +from Components.Sources.FrontendStatus import FrontendStatus +from Components.Sources.Source import Source + +class SessionGlobals(Screen): + def __init__(self, session): + Screen.__init__(self, session) + self["CurrentService"] = CurrentService(self.session.nav) + self["Event_Now"] = EventInfo(self.session.nav, EventInfo.NOW) + self["Event_Next"] = EventInfo(self.session.nav, EventInfo.NEXT) + self["FrontendStatus"] = FrontendStatus(service_source = self.session.nav.getCurrentService) + self["VideoPicture"] = Source() |
