Hook factorisation ; add new hooks : default (same comportement has previous version) and one hook before any parsing

When calling a hook, passed parameters change according to associated data variable
This commit is contained in:
Némunaire 2012-08-22 21:05:33 +02:00
commit 7e20368c10
8 changed files with 109 additions and 63 deletions

View file

@ -19,7 +19,7 @@ def load(context):
context.hooks.add_hook(context.hooks.cmd_hook, Hook(cmd_syno, "synonyme"))
def cmd_syno(data, msg):
def cmd_syno(msg):
if 1 < len(msg.cmd) < 6:
for word in msg.cmd[1:]:
synos = get_synos(word)