Moved StringWithSpaceOnRight to registry.py.

This commit is contained in:
Jeremy Fincher 2004-01-23 13:28:53 +00:00
parent e189ec24a8
commit c4bb73205f
2 changed files with 8 additions and 8 deletions

View File

@ -61,12 +61,6 @@ def configure(onStart, afterConnect, advanced):
url = something('What\'s the URL of the RSS feed?') url = something('What\'s the URL of the RSS feed?')
onStart.append('rss add %s %s' % (name, url)) onStart.append('rss add %s %s' % (name, url))
class StringWithSpaceOnRight(registry.String):
def setValue(self, v):
if v.rstrip() == v:
v += ' '
registry.String.setValue(self, v)
conf.registerPlugin('RSS') conf.registerPlugin('RSS')
conf.registerChannelValue(conf.supybot.plugins.RSS, 'bold', registry.Boolean( conf.registerChannelValue(conf.supybot.plugins.RSS, 'bold', registry.Boolean(
True, """Determines whether the bot will bold the title of the feed when it True, """Determines whether the bot will bold the title of the feed when it
@ -75,8 +69,8 @@ conf.registerChannelValue(conf.supybot.plugins.RSS, 'headlineSeparator',
registry.StringSurroundedBySpaces(' || ', """Determines what string is used registry.StringSurroundedBySpaces(' || ', """Determines what string is used
to separate headlines in new feeds.""")) to separate headlines in new feeds."""))
conf.registerChannelValue(conf.supybot.plugins.RSS, 'announcementPrefix', conf.registerChannelValue(conf.supybot.plugins.RSS, 'announcementPrefix',
StringWithSpaceOnRight('New news from ', """Determines what prefix is registry.StringWithSpaceOnRight('New news from ', """Determines what prefix
prepended (if any) to the new news item announcements made in the is prepended (if any) to the new news item announcements made in the
channel.""")) channel."""))
conf.registerChannelValue(conf.supybot.plugins.RSS, 'announce', conf.registerChannelValue(conf.supybot.plugins.RSS, 'announce',
registry.SpaceSeparatedListOfStrings([], """Determines which RSS feeds registry.SpaceSeparatedListOfStrings([], """Determines which RSS feeds

View File

@ -207,6 +207,12 @@ class StringSurroundedBySpaces(String):
v += ' ' v += ' '
String.setValue(self, v) String.setValue(self, v)
class StringWithSpaceOnRight(String):
def setValue(self, v):
if v.rstrip() == v:
v += ' '
String.setValue(self, v)
class SeparatedListOf(Value): class SeparatedListOf(Value):
Value = Value Value = Value
def splitter(self, s): def splitter(self, s):