diff options
author | Kali Kaneko <kali@leap.se> | 2015-09-16 12:20:22 -0400 |
---|---|---|
committer | Kali Kaneko <kali@leap.se> | 2015-09-16 12:29:45 -0400 |
commit | 967763e8d0cc5f70f0760994d87500e30ad724a7 (patch) | |
tree | 0d8b8fd6246585b73726e052aa4844ab3850d9dc /src/leap/common/events/client.py | |
parent | d4e4d3dc8ff88d98477e1fcd1104d7cd8b9e6612 (diff) |
[refactor] move checking flag to main module
Diffstat (limited to 'src/leap/common/events/client.py')
-rw-r--r-- | src/leap/common/events/client.py | 13 |
1 files changed, 5 insertions, 8 deletions
diff --git a/src/leap/common/events/client.py b/src/leap/common/events/client.py index e085f5b..e38e9d3 100644 --- a/src/leap/common/events/client.py +++ b/src/leap/common/events/client.py @@ -465,7 +465,7 @@ class EventsClientThread(threading.Thread, EventsClient): Make sure the events client thread is started. """ with self._lock: - if flags.EVENTS_ENABLED and not self.is_alive(): + if not self.is_alive(): self.daemon = True self.start() self._initialized.wait() @@ -508,9 +508,8 @@ def register(event, callback, uid=None, replace=False): :raises CallbackAlreadyRegisteredError: when there's already a callback identified by the given uid and replace is False. """ - if flags.EVENTS_ENABLED: - return EventsClientThread.instance().register( - event, callback, uid=uid, replace=replace) + return EventsClientThread.instance().register( + event, callback, uid=uid, replace=replace) def unregister(event, uid=None): @@ -525,8 +524,7 @@ def unregister(event, uid=None): :param uid: The callback uid. :type uid: str """ - if flags.EVENTS_ENABLED: - return EventsClientThread.instance().unregister(event, uid=uid) + return EventsClientThread.instance().unregister(event, uid=uid) def emit(event, *content): @@ -538,8 +536,7 @@ def emit(event, *content): :param content: The content of the event. :type content: list """ - if flags.EVENTS_ENABLED: - return EventsClientThread.instance().emit(event, *content) + return EventsClientThread.instance().emit(event, *content) def instance(): |