provider-selection is now possible for cable and terrestrial
[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                 self.onClose = [ ]
15                 
16                 # in order to support screens *without* a help,
17                 # we need the list in every screen. how ironic.
18                 self.helpList = [ ]
19                 
20         def execBegin(self):
21 #               assert self.session == None, "a screen can only exec one per time"
22 #               self.session = session
23                 for (name, val) in self.items():
24                         val.execBegin()
25         
26         def execEnd(self):
27                 for (name, val) in self.items():
28                         val.execEnd()
29 #               assert self.session != None, "execEnd on non-execing screen!"
30 #               self.session = None
31         
32         # never call this directly - it will be called from the session!
33         def doClose(self):
34                 for x in self.onClose:
35                         x()
36                 
37                 # fixup circular references
38                 del self.helpList
39                 GUISkin.close(self)
40                 
41                 del self.session
42                 for (name, val) in self.items():
43                         del self[name]
44         
45         def close(self, *retval):
46                 self.session.close(*retval)
47
48         def setFocus(self, o):
49                 self.instance.setFocus(o.instance)