diff options
| author | 2019-07-30 15:24:13 +0100 | |
|---|---|---|
| committer | 2019-07-30 15:24:13 +0100 | |
| commit | dd8b276b352f31669535d384d40812b1e30f7fc1 (patch) | |
| tree | a5d81acce8473a191be4f575496d9f07a455b4a5 | |
| parent | Revert "hook priority position should default to 0, not end" (diff) | |
| signature | ||
pull `priority` out of `kwargs` in _hook
| -rw-r--r-- | src/EventManager.py | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/src/EventManager.py b/src/EventManager.py index 5a19f35e..5dd0e3e7 100644 --- a/src/EventManager.py +++ b/src/EventManager.py @@ -90,6 +90,10 @@ class Events(object): self._hook(func, priority, list(kwargs.items())) def _hook(self, func: CALLBACK_TYPE, priority: int = DEFAULT_PRIORITY, kwargs: typing.List[typing.Tuple[str, typing.Any]] = []): + for key, value in kwargs: + if key == "priority": + priority = value + break self._root._hook(self._path, func, self._context, priority, kwargs) def call(self, **kwargs): |
