src/irclib: Let's not override the name for the set type.

This commit is contained in:
James Vega 2005-07-10 18:27:40 +00:00
parent 14dc0c0201
commit 6f8e3d37aa

View File

@ -290,24 +290,24 @@ class ChannelState(object):
def doMode(self, msg): def doMode(self, msg):
def getSet(c): def getSet(c):
if c == 'o': if c == 'o':
set = self.ops Set = self.ops
elif c == 'v': elif c == 'v':
set = self.voices Set = self.voices
elif c == 'h': elif c == 'h':
set = self.halfops Set = self.halfops
elif c == 'b': elif c == 'b':
set = self.bans Set = self.bans
else: # We don't care yet, so we'll just return an empty set. else: # We don't care yet, so we'll just return an empty set.
set = set() Set = set()
return set return Set
for (mode, value) in ircutils.separateModes(msg.args[1:]): for (mode, value) in ircutils.separateModes(msg.args[1:]):
(action, modeChar) = mode (action, modeChar) = mode
if modeChar in 'ovhbeq': # We don't handle e or q yet. if modeChar in 'ovhbeq': # We don't handle e or q yet.
set = getSet(modeChar) Set = getSet(modeChar)
if action == '-': if action == '-':
set.discard(value) Set.discard(value)
elif action == '+': elif action == '+':
set.add(value) Set.add(value)
else: else:
if action == '+': if action == '+':
self.setMode(modeChar, value) self.setMode(modeChar, value)