Added removeChannel to the SpaceSeparatedListOfChannels.

This commit is contained in:
Jeremy Fincher 2004-03-25 12:15:57 +00:00
parent a898bdaa94
commit ae97d0390a

View File

@ -121,6 +121,17 @@ class SpaceSeparatedSetOfChannels(registry.SeparatedListOf):
return s.split() return s.split()
joiner = ' '.join joiner = ' '.join
def removeChannel(self, channel):
removals = []
for c in self.value:
chan = c
if ',' in c:
(chan, _) = c.split(',')
if chan == channel:
removals.append(c)
for removal in removals:
self.value.remove(discard)
supybot.register('channels', SpaceSeparatedSetOfChannels(['#supybot'], """ supybot.register('channels', SpaceSeparatedSetOfChannels(['#supybot'], """
Determines what channels the bot will join when it connects to the server.""")) Determines what channels the bot will join when it connects to the server."""))