X-Git-Url: http://www.chiark.greenend.org.uk/ucgi/~matthewv/git?a=blobdiff_plain;f=commands.py;h=637ec5fddffbbb14f4d1d9c0b5c2b302f2c48753;hb=9e280b60903fa9ce16809540ec6c8174adb762cd;hp=4bdc45ce01dcc632ae861a4194ced4a9f5c48aed;hpb=9a8c6f919c6e2df251c611630a1d4bdfb4205548;p=irc.git diff --git a/commands.py b/commands.py index 4bdc45c..637ec5f 100644 --- a/commands.py +++ b/commands.py @@ -251,7 +251,7 @@ def defineq(bot, cmd, nick, conn, public): else: # We assume google has truncated the definition for us so this # won't flood the channel with text... - defn = " ".join(match.group(1).split("\n")); + defn = " ".join(match.group(1).split("\n")) bot.automsg(public,nick,defn) except IOError: # if the connection times out. This blocks. :( bot.automsg(public,nick,"The web's broken. Waah!") @@ -280,8 +280,11 @@ def disconnq(bot, cmd, nick, conn, public): bot.disconnect(msg="Be right back.") ### list keys of a dictionary -def listkeysq(bot, cmd, nick, conn, public, dict): - bot.automsg(public,nick,string.join(dict.keys())) +def listkeysq(bot, cmd, nick, conn, public, dict, sort=False): + d=dict.keys() + if sort: + d.sort() + bot.automsg(public,nick,string.join(d)) ### rot13 text (yes, I could have typed out the letters....) ### also "foo".encode('rot13') would have worked