aboutsummaryrefslogtreecommitdiff
path: root/lib/python/Components/Sources/StaticText.py
blob: 6f775c443b0aa2c44a6116bc461dbe5ec82122dd (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
from Source import Source

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)