diff --git a/src/ModuleManager.py b/src/ModuleManager.py index 65f7c11e..50af3493 100644 --- a/src/ModuleManager.py +++ b/src/ModuleManager.py @@ -239,15 +239,16 @@ class ModuleManager(object): # @utils.hook() magic for attribute_name in dir(module_object): attribute = getattr(module_object, attribute_name) - if inspect.ismethod(attribute) and utils.has_magic(attribute): - magic = utils.get_magic(attribute) + if (inspect.ismethod(attribute) and + utils.decorators.has_magic(attribute)): + magic = utils.decorators.get_magic(attribute) for hook, kwargs in magic.get_hooks(): context_events.on(hook)._hook(attribute, kwargs=kwargs) # @utils.export() magic - if utils.has_magic(module_object): - magic = utils.get_magic(module_object) + if utils.decorators.has_magic(module_object): + magic = utils.decorators.get_magic(module_object) for key, value in magic.get_exports(): context_exports.add(key, value) diff --git a/src/utils/__init__.py b/src/utils/__init__.py index 1013b2ac..b7b581e2 100644 --- a/src/utils/__init__.py +++ b/src/utils/__init__.py @@ -1,8 +1,8 @@ import contextlib, datetime, decimal, enum, io, ipaddress, multiprocessing import queue, re, signal, threading, typing -from . import cli, consts, irc, http, parse, security +from . import cli, consts, decorators, irc, http, parse, security -from .decorators import export, get_magic, has_magic, hook, kwarg +from .decorators import export, hook, kwarg from .settings import (BoolSetting, FunctionSetting, IntRangeSetting, IntSetting, OptionsSetting, sensitive_format, SensitiveSetting, Setting)