Modify hook handling

This commit is contained in:
Vgr E.Barry 2015-06-04 10:55:53 -04:00
parent ee97d6f45e
commit 4382d91008
2 changed files with 1 additions and 4 deletions

View File

@ -181,9 +181,6 @@ class hook:
self.__doc__ = self.func.__doc__ self.__doc__ = self.func.__doc__
return self return self
def caller(self, *args):
return self.func(*args)
@staticmethod @staticmethod
def unhook(hookid): def unhook(hookid):
for each in list(HOOKS): for each in list(HOOKS):

View File

@ -94,7 +94,7 @@ def unhandled(cli, prefix, cmd, *args):
if isinstance(arg, bytes): largs[i] = arg.decode('ascii') if isinstance(arg, bytes): largs[i] = arg.decode('ascii')
for fn in decorators.HOOKS.get(cmd, []): for fn in decorators.HOOKS.get(cmd, []):
try: try:
fn.caller(cli, prefix, *largs) fn.func(cli, prefix, *largs)
except Exception as e: except Exception as e:
if botconfig.DEBUG_MODE: if botconfig.DEBUG_MODE:
raise e raise e