Slight cleanups.

This commit is contained in:
Jeremy Fincher 2004-07-21 18:49:27 +00:00
parent a95f1bc28c
commit 70efdfbea1
2 changed files with 5 additions and 9 deletions

View File

@ -171,12 +171,9 @@ for (name, s) in registry._cache.iteritems():
registerNetwork(name) registerNetwork(name)
class SpaceSeparatedSetOfChannels(registry.SeparatedListOf): class SpaceSeparatedSetOfChannels(registry.SpaceSeparatedListOf):
List = ircutils.IrcSet List = ircutils.IrcSet
Value = ValidChannel Value = ValidChannel
def splitter(self, s):
return s.split()
joiner = ' '.join
def removeChannel(self, channel): def removeChannel(self, channel):
removals = [] removals = []

View File

@ -444,21 +444,20 @@ class SeparatedListOf(Value):
# config parser doesn't care about this space, we'll use it :) # config parser doesn't care about this space, we'll use it :)
return ' ' return ' '
class SpaceSeparatedListOfStrings(SeparatedListOf): class SpaceSeparatedListOf(SeparatedListOf):
Value = String
def splitter(self, s): def splitter(self, s):
return s.split() return s.split()
joiner = ' '.join joiner = ' '.join
class SpaceSeparatedListOfStrings(SpaceSeparatedListOf):
Value = String
class CommaSeparatedListOfStrings(SeparatedListOf): class CommaSeparatedListOfStrings(SeparatedListOf):
Value = String Value = String
def splitter(self, s): def splitter(self, s):
return re.split(r'\s*,\s*', s) return re.split(r'\s*,\s*', s)
joiner = ', '.join joiner = ', '.join
class CommaSeparatedSetOfStrings(CommaSeparatedListOfStrings):
List = sets.Set
if __name__ == '__main__': if __name__ == '__main__':
#if 1: #if 1: