Various sorted updates (pun intended, punks :))

This commit is contained in:
Jeremy Fincher 2004-04-20 10:11:27 +00:00
parent ed8df0a998
commit d3d43f8a0c
2 changed files with 2 additions and 12 deletions

View File

@ -435,8 +435,7 @@ class Channel(callbacks.Privmsg):
s = 'I\'m not currently ignoring any hostmasks in %r' % channel
irc.reply(s)
else:
L = c.ignores[:]
L.sort()
L = sorted(c.ignores)
irc.reply(utils.commaAndify(imap(repr, L)))
ignores = privmsgs.checkChannelCapability(ignores, 'op')
@ -542,8 +541,7 @@ class Channel(callbacks.Privmsg):
"""
channel = privmsgs.getChannel(msg, args)
c = ircdb.channels.getChannel(channel)
L = list(c.capabilities)
L.sort()
L = sorted(c.capabilities)
irc.reply('[%s]' % '; '.join(L))
def lobotomies(self, irc, msg, args):

View File

@ -168,14 +168,6 @@ def rsplit(s, sep=None, maxsplit=-1):
L.reverse()
return [s[::-1] for s in L]
def sorted(iterable, cmp=None, key=None, reverse=False):
L = list(iterable)
## if key is None:
## L.sort(cmp)
## else:
## # Oops, we don't have sortBy. Let's come back to this.utils.
## utils.sortBy(key
import operator
def itemgetter(i):
return lambda x: x[i]