Now we can sort names independent of case!

This commit is contained in:
James Vega 2003-11-20 23:46:56 +00:00
parent 8b9f5a607f
commit e3b09746c0

View File

@ -284,6 +284,8 @@ class Relay(callbacks.Privmsg, plugins.Configurable):
the channel itself. Returns the nicks of the people in the channel on the channel itself. Returns the nicks of the people in the channel on
the various networks the bot is connected to. the various networks the bot is connected to.
""" """
def comp(x, y):
return cmp(x.lower(), y.lower())
if not self.started: if not self.started:
irc.error(msg, 'You must use the start command first.') irc.error(msg, 'You must use the start command first.')
return return
@ -320,10 +322,10 @@ class Relay(callbacks.Privmsg, plugins.Configurable):
voices.append('+%s' % s) voices.append('+%s' % s)
else: else:
usersS.append(s) usersS.append(s)
ops.sort() ops.sort(comp)
voices.sort() voices.sort(comp)
usersS.sort() usersS.sort(comp)
halfops.sort() halfops.sort(comp)
usersS = ', '.join(ifilter(None, imap(', '.join, usersS = ', '.join(ifilter(None, imap(', '.join,
(ops,halfops,voices,usersS)))) (ops,halfops,voices,usersS))))
users.append('%s: %s' % (ircutils.bold(abbreviation), usersS)) users.append('%s: %s' % (ircutils.bold(abbreviation), usersS))