3
0
mirror of https://github.com/jlu5/PyLink.git synced 2024-12-24 11:42:51 +01:00

commands: explicitly sort mode lists in 'showuser' and 'showchan'

(cherry picked from commit eb032eb7f9)
This commit is contained in:
James Lu 2016-07-31 21:46:33 -07:00
parent c9ce4d1507
commit 8e5c58d897

View File

@ -51,7 +51,7 @@ def showuser(irc, source, args):
if verbose: # Oper only data: user modes, channels on, account info, etc.
f('\x02User modes\x02: %s' % irc.joinModes(userobj.modes))
f('\x02User modes\x02: %s' % irc.joinModes(userobj.modes, sort=True))
f('\x02Protocol UID\x02: %s; \x02Real host\x02: %s; \x02IP\x02: %s' % \
(u, userobj.realhost, userobj.ip))
channels = sorted(userobj.channels)
@ -92,7 +92,7 @@ def showchan(irc, source, args):
f('\x02Channel topic\x02: %s' % c.topic)
f('\x02Channel creation time\x02: %s (%s)' % (ctime(c.ts), c.ts))
# Show only modes that aren't list-style modes.
modes = irc.joinModes([m for m in c.modes if m[0] not in irc.cmodes['*A']])
modes = irc.joinModes([m for m in c.modes if m[0] not in irc.cmodes['*A']], sort=True)
f('\x02Channel modes\x02: %s' % modes)
if verbose:
nicklist = []