diff options
| author | 2019-11-15 14:09:35 +0000 | |
|---|---|---|
| committer | 2019-11-15 14:09:35 +0000 | |
| commit | 5d550868471aeb1d680610989b9b5c8e4bb2b49b (patch) | |
| tree | 51213a349ebf645c2988d9b1fc932a1c2e0b5e9e /src/utils | |
| parent | move all datetime-related code from utils/__init__ to utils.datetime (diff) | |
| signature | ||
move utils.consts.BITBOT_MAGIC to utils.decorators
Diffstat (limited to 'src/utils')
| -rw-r--r-- | src/utils/consts.py | 2 | ||||
| -rw-r--r-- | src/utils/decorators.py | 9 |
2 files changed, 5 insertions, 6 deletions
diff --git a/src/utils/consts.py b/src/utils/consts.py index 9a6e973b..d53a4660 100644 --- a/src/utils/consts.py +++ b/src/utils/consts.py @@ -1,8 +1,6 @@ import typing from . import _consts_256_color -BITBOT_MAGIC = "__bitbot" - class IRCColor(object): def __init__(self, irc: int, ansi: int, is_256): self.irc = irc diff --git a/src/utils/decorators.py b/src/utils/decorators.py index f6897e17..dc4adf3a 100644 --- a/src/utils/decorators.py +++ b/src/utils/decorators.py @@ -1,5 +1,6 @@ import typing -from . import consts + +BITBOT_MAGIC = "__bitbot" class BitBotMagic(object): def __init__(self): @@ -24,10 +25,10 @@ class BitBotMagic(object): def get_magic(obj: typing.Any): if not has_magic(obj): - setattr(obj, consts.BITBOT_MAGIC, BitBotMagic()) - return getattr(obj, consts.BITBOT_MAGIC) + setattr(obj, BITBOT_MAGIC, BitBotMagic()) + return getattr(obj, BITBOT_MAGIC) def has_magic(obj: typing.Any): - return hasattr(obj, consts.BITBOT_MAGIC) + return hasattr(obj, BITBOT_MAGIC) def hook(event: str, **kwargs): def _hook_func(func): |
