insert decorator kwargs because decorators are run innermost first

This commit is contained in:
jesopo 2020-02-27 17:58:06 +00:00
parent c3720ce4fa
commit 8c9bfe9a2d

View file

@ -11,7 +11,7 @@ class BitBotMagic(object):
def add_hook(self, hook: str, kwargs: dict): def add_hook(self, hook: str, kwargs: dict):
self._hooks.append((hook, kwargs)) self._hooks.append((hook, kwargs))
def add_kwarg(self, key: str, value: typing.Any): def add_kwarg(self, key: str, value: typing.Any):
self._kwargs.append((key, value)) self._kwargs.insert(0, (key, value))
def get_hooks(self): def get_hooks(self):
hooks: typing.List[typing.Tuple[str, typing.List[Tuple[str, typing.Any]]]] = [] hooks: typing.List[typing.Tuple[str, typing.List[Tuple[str, typing.Any]]]] = []