install_PYTHON = \
__init__.py Clock.py EventInfo.py Source.py MenuList.py CurrentService.py \
- FrontendStatus.py Boolean.py Config.py ServiceList.py RadioText.py StreamService.py
-
+ FrontendStatus.py Boolean.py Config.py ServiceList.py RadioText.py StreamService.py \
+ StaticText.py
--- /dev/null
+from Source import Source
+from Components.Element import cached
+
+class StaticText(Source):
+ # filter is a function which filters external, untrusted strings
+ # this must be done to avoid XSS attacks!
+
+ # (and is probably not done yet. For this reason, be careful when
+ # using this on HTML pages. *DO* provide your filter function.)
+ def __init__(self, text = "", filter = lambda x: x):
+ Source.__init__(self)
+ self.text = text
+ self.filter = filter
+
+ def handleCommand(self, cmd):
+ self.text = self.filter(cmd)