make urlhistory nick sorting case-insensitive, simplify a few decorator calls
This commit is contained in:
parent
8271b23cb6
commit
c6c94c9ecb
|
@ -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:
|
||||
|
|
|
@ -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)
|
||||
|
|
|
@ -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:
|
||||
|
|
|
@ -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 ''' \
|
||||
|
|
Loading…
Reference in New Issue