From c6c94c9ecb594ecd07cfc89d1a0ec9ffefc044f6 Mon Sep 17 00:00:00 2001 From: Ryan Hitchman Date: Mon, 18 Jan 2010 22:14:49 -0700 Subject: [PATCH] make urlhistory nick sorting case-insensitive, simplify a few decorator calls --- plugins/explain.py | 2 +- plugins/tell.py | 2 +- plugins/urlhistory.py | 2 +- plugins/wikipedia.py | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/plugins/explain.py b/plugins/explain.py index 33b78a1..6d65082 100755 --- a/plugins/explain.py +++ b/plugins/explain.py @@ -1,7 +1,7 @@ from util import hook from pycparser.cdecl import explain_c_declaration -@hook.command('explain') +@hook.command def explain(inp): ".explain -- gives an explanation of C expression" if not inp: diff --git a/plugins/tell.py b/plugins/tell.py index b2f1237..114b1b5 100644 --- a/plugins/tell.py +++ b/plugins/tell.py @@ -17,7 +17,7 @@ def adapt_datetime(ts): sqlite3.register_adapter(datetime, adapt_datetime) -@hook.command(hook=r'(.*)', prefix=False, ignorebots=True) +@hook.command(hook=r'(.*)', prefix=False) def tellinput(bot, input): dbpath = os.path.join(bot.persist_dir, dbname) conn = dbconnect(dbpath) diff --git a/plugins/urlhistory.py b/plugins/urlhistory.py index ebfd313..2988659 100644 --- a/plugins/urlhistory.py +++ b/plugins/urlhistory.py @@ -37,7 +37,7 @@ def get_history(conn, server, chan, url): return [x[0] for x in nicks] def get_nicklist(nicks): - nicks = sorted(set(nicks)) + nicks = sorted(set(nicks), key=unicode.lower) if len(nicks) <= 2: return ' and '.join(nicks) else: diff --git a/plugins/wikipedia.py b/plugins/wikipedia.py index 93eaa87..5ddf19f 100644 --- a/plugins/wikipedia.py +++ b/plugins/wikipedia.py @@ -14,7 +14,7 @@ search_url = api_prefix + "?action=opensearch&search=%s&format=xml" paren_re = re.compile('\s*\(.*\)$') -@hook.command(hook='w(\s+.*|$)') +@hook.command('w') @hook.command def wiki(inp): '''.w/.wiki -- gets first sentence of wikipedia ''' \