add help stuff
[enigma2.git] / lib / python / Screens / Screen.py
1 from Components.HTMLSkin import *
2 from Components.GUISkin import *
3
4 import sys
5
6 class Screen(dict, HTMLSkin, GUISkin):
7         """ bla """
8
9         def __init__(self, session):
10                 self.skinName = self.__class__.__name__
11                 self.session = session
12                 GUISkin.__init__(self)
13                 
14                 # in order to support screens *without* a help,
15                 # we need the list in every screen. how ironic.
16                 self.helpList = [ ]
17                 
18         def execBegin(self):
19 #               assert self.session == None, "a screen can only exec one per time"
20 #               self.session = session
21                 for (name, val) in self.items():
22                         val.execBegin()
23         
24         def execEnd(self):
25                 for (name, val) in self.items():
26                         val.execEnd()
27 #               assert self.session != None, "execEnd on non-execing screen!"
28 #               self.session = None
29         
30         # never call this directly - it will be called from the session!
31         def doClose(self):
32                 # fixup circular references
33                 del self.helpList
34                 GUISkin.close(self)
35                 
36                 del self.session
37                 for (name, val) in self.items():
38                         del self[name]
39         
40         def close(self, *retval):
41                 self.session.close(*retval)
42
43         def setFocus(self, o):
44                 self.instance.setFocus(o.instance)