Let's make sure is always in the string.

This commit is contained in:
Jeremy Fincher 2004-08-21 09:49:45 +00:00
parent 6ecf2ae6ea
commit 4a36ef95ec
1 changed files with 10 additions and 1 deletions

View File

@ -55,8 +55,17 @@ conf.registerPlugin('Topic')
conf.registerChannelValue(conf.supybot.plugins.Topic, 'separator', conf.registerChannelValue(conf.supybot.plugins.Topic, 'separator',
registry.StringSurroundedBySpaces(' || ', """Determines what separator is registry.StringSurroundedBySpaces(' || ', """Determines what separator is
used between individually added topics in the channel topic.""")) used between individually added topics in the channel topic."""))
class TopicFormat(registry.String):
"Value must include $topic, otherwise the actual topic would be left out."
def setValue(self, v):
if '$topic' in v or '${topic}' in v:
registry.String.setValue(self, v)
else:
self.error()
conf.registerChannelValue(conf.supybot.plugins.Topic, 'format', conf.registerChannelValue(conf.supybot.plugins.Topic, 'format',
registry.String('$topic ($nick)', """Determines what format is used to add TopicFormat('$topic ($nick)', """Determines what format is used to add
topics in the topic. All the standard substitutes apply, in addiction to topics in the topic. All the standard substitutes apply, in addiction to
"$topic" for the topic itself.""")) "$topic" for the topic itself."""))