make urlhistory nick sorting case-insensitive, simplify a few decorator calls

This commit is contained in:
Ryan Hitchman 2010-01-18 22:14:49 -07:00
parent 8271b23cb6
commit c6c94c9ecb
4 changed files with 4 additions and 4 deletions

View File

@ -1,7 +1,7 @@
from util import hook
from pycparser.cdecl import explain_c_declaration
@hook.command('explain')
@hook.command
def explain(inp):
".explain <c expression> -- gives an explanation of C expression"
if not inp:

View File

@ -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)

View File

@ -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:

View File

@ -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 <phrase> -- gets first sentence of wikipedia ''' \