aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorGravatar jesopo2019-10-29 18:00:59 +0000
committerGravatar jesopo2019-10-29 18:00:59 +0000
commit9b349f8cc0435a17d333819207f238a12295bf7e (patch)
tree609e463c12fe2625d80c53e7309fbf30b8e72677 /src
parentutils.cli shouldn't know about Database (diff)
signature
move typing.Callable def so Event doesn't have to be in " "
Diffstat (limited to 'src')
-rw-r--r--src/EventManager.py4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/EventManager.py b/src/EventManager.py
index 7acd98f9..46ea3ed7 100644
--- a/src/EventManager.py
+++ b/src/EventManager.py
@@ -11,8 +11,6 @@ DEFAULT_PRIORITY = PRIORITY_MEDIUM
DEFAULT_EVENT_DELIMITER = "."
DEFAULT_MULTI_DELIMITER = "|"
-CALLBACK_TYPE = typing.Callable[["Event"], typing.Any]
-
class Event(object):
def __init__(self, name: str, kwargs):
self.name = name
@@ -27,6 +25,8 @@ class Event(object):
def eat(self):
self.eaten = True
+CALLBACK_TYPE = typing.Callable[[Event], typing.Any]
+
class EventHook(object):
def __init__(self, event_name: str, func: CALLBACK_TYPE,
context: typing.Optional[str], priority: int,