Update Topic to use registry.TemplatedString

Signed-off-by: James Vega <jamessan@users.sourceforge.net>
This commit is contained in:
James Vega 2009-10-15 22:35:17 -04:00
parent 035a9f2459
commit 5af38453a8

View File

@ -39,13 +39,9 @@ def configure(advanced):
conf.registerPlugin('Topic', True) conf.registerPlugin('Topic', True)
class TopicFormat(registry.String): class TopicFormat(registry.TemplatedString):
"Value must include $topic, otherwise the actual topic would be left out." "Value must include $topic, otherwise the actual topic would be left out."
def setValue(self, v): requiredTemplates = ['topic']
if '$topic' in v or '${topic}' in v:
registry.String.setValue(self, v)
else:
self.error()
Topic = conf.registerPlugin('Topic') Topic = conf.registerPlugin('Topic')
conf.registerChannelValue(Topic, 'separator', conf.registerChannelValue(Topic, 'separator',