From b69bd212a37eee3cef33631102ad36e879514379 Mon Sep 17 00:00:00 2001 From: Ryan Hitchman Date: Thu, 11 Mar 2010 17:28:17 -0700 Subject: [PATCH] make events take param lists intead of param strings --- core/main.py | 3 ++- plugins/log.py | 2 +- plugins/misc.py | 9 ++++----- plugins/seen.py | 2 +- plugins/tell.py | 2 +- 5 files changed, 9 insertions(+), 9 deletions(-) diff --git a/core/main.py b/core/main.py index ba0bcfc..7eecd5c 100644 --- a/core/main.py +++ b/core/main.py @@ -36,8 +36,9 @@ class Input(dict): def run(func, input): args = func._args + if 'inp' not in input: - input.inp = input.params + input.inp = input.paraml if args: if 'db' in args: diff --git a/plugins/log.py b/plugins/log.py index b9857a7..ce1bf1f 100644 --- a/plugins/log.py +++ b/plugins/log.py @@ -85,7 +85,7 @@ def get_log_fd(dir, server, chan): @hook.thread @hook.event('*') -def log(inp, input=None, bot=None): +def log(paraml, input=None, bot=None): with lock: timestamp = gmtime(timestamp_format) diff --git a/plugins/misc.py b/plugins/misc.py index 697318f..f628ad5 100644 --- a/plugins/misc.py +++ b/plugins/misc.py @@ -8,7 +8,7 @@ socket.setdefaulttimeout(10) # global setting #autorejoin channels @hook.event('KICK') -def rejoin(inp, paraml=[], conn=None): +def rejoin(paraml, conn=None): if paraml[1] == conn.nick: if paraml[0].lower() in conn.channels: conn.join(paraml[0]) @@ -16,14 +16,13 @@ def rejoin(inp, paraml=[], conn=None): #join channels when invited @hook.event('INVITE') -def invite(inp, command='', conn=None): - if command == 'INVITE': - conn.join(inp) +def invite(paraml, conn=None): + conn.join(paraml[-1]) #join channels when server says hello & identify bot @hook.event('004') -def onjoin(inp, conn=None): +def onjoin(paraml, conn=None): nickserv_password = conn.conf.get('nickserv_password', '') nickserv_name = conn.conf.get('nickserv_name', 'nickserv') nickserv_command = conn.conf.get('nickserv_command', 'IDENTIFY %s') diff --git a/plugins/seen.py b/plugins/seen.py index 51f9386..152c7d6 100644 --- a/plugins/seen.py +++ b/plugins/seen.py @@ -7,7 +7,7 @@ from util import hook, timesince @hook.thread @hook.event('PRIVMSG') -def seeninput(inp, input=None, bot=None): +def seeninput(paraml, input=None, bot=None): db = bot.get_db_connection(input.server) db_init(db) db.execute("insert or replace into seen(name, time, quote, chan)" diff --git a/plugins/tell.py b/plugins/tell.py index c15f78e..2951b07 100644 --- a/plugins/tell.py +++ b/plugins/tell.py @@ -14,7 +14,7 @@ def get_tells(db, user_to, chan): @hook.thread @hook.event('PRIVMSG') -def tellinput(inp, input=None, bot=None): +def tellinput(paraml, input=None, bot=None): if 'showtells' in input.msg.lower(): return