1 from Source import Source
3 class StaticText(Source):
4 # filter is a function which filters external, untrusted strings
5 # this must be done to avoid XSS attacks!
7 # (and is probably not done yet. For this reason, be careful when
8 # using this on HTML pages. *DO* provide your filter function.)
9 def __init__(self, text = "", filter = lambda x: x):
14 def handleCommand(self, cmd):
15 self.text = self.filter(cmd)
20 def setText(self, text):
22 self.changed((self.CHANGED_ALL,))
24 text = property(getText, setText)