diff options
| author | Felix Domke <tmbinc@elitedvb.net> | 2007-01-09 02:08:11 +0000 |
|---|---|---|
| committer | Felix Domke <tmbinc@elitedvb.net> | 2007-01-09 02:08:11 +0000 |
| commit | 3e35c703607b5f135828fa5efe2beee669c7a4c2 (patch) | |
| tree | 26fc6659d072f6fa9b5eff0fc056e940ee639592 /lib/python/Components/Sources | |
| parent | 3d05d094d74426a9e3df2517ee0a17ac7e6ca5d3 (diff) | |
| download | enigma2-3e35c703607b5f135828fa5efe2beee669c7a4c2.tar.gz enigma2-3e35c703607b5f135828fa5efe2beee669c7a4c2.zip | |
add StaticText source, which can be used as a simple way to forward values between web pages
Diffstat (limited to 'lib/python/Components/Sources')
| -rw-r--r-- | lib/python/Components/Sources/Makefile.am | 4 | ||||
| -rw-r--r-- | lib/python/Components/Sources/StaticText.py | 16 |
2 files changed, 18 insertions, 2 deletions
diff --git a/lib/python/Components/Sources/Makefile.am b/lib/python/Components/Sources/Makefile.am index c03d89eb..5e6a30a5 100644 --- a/lib/python/Components/Sources/Makefile.am +++ b/lib/python/Components/Sources/Makefile.am @@ -2,5 +2,5 @@ installdir = $(LIBDIR)/enigma2/python/Components/Sources 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 diff --git a/lib/python/Components/Sources/StaticText.py b/lib/python/Components/Sources/StaticText.py new file mode 100644 index 00000000..2f8f0e18 --- /dev/null +++ b/lib/python/Components/Sources/StaticText.py @@ -0,0 +1,16 @@ +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) |
