From 895a38716993d0c334442399993825d5f2b620ea Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?B=C3=A1lint=20Bokros?= Date: Tue, 5 Dec 2017 20:34:06 +0100 Subject: [PATCH] Remove passing self to event handler functions --- src/event_handlers/event_handler_main.py | 4 ++-- src/event_handlers/stateful_event_handler.py | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/event_handlers/event_handler_main.py b/src/event_handlers/event_handler_main.py index 52f5130..e7ca7e3 100644 --- a/src/event_handlers/event_handler_main.py +++ b/src/event_handlers/event_handler_main.py @@ -28,7 +28,7 @@ def reverse_handler(data): return data -def login_handler(data, component): +def login_handler(data): email, password = data['data']['email'], data['data']['password'] try: sql_statement = source_code.find_local_variable_value(authorize_login, 'sql_statement') @@ -70,7 +70,7 @@ def login_handler(data, component): yield ('anchor_login', '# Login page\n' + response) -def source_code_handler(data, event_handler): +def source_code_handler(data): yield (data['anchor'], source_code.get_source_code(authorize_login, strip_comments=True)) diff --git a/src/event_handlers/stateful_event_handler.py b/src/event_handlers/stateful_event_handler.py index f8b9a08..2f91f4b 100644 --- a/src/event_handlers/stateful_event_handler.py +++ b/src/event_handlers/stateful_event_handler.py @@ -17,7 +17,7 @@ class StatefulEventHandler(EventHandlerBase): return data_json = json.loads(message) if self.generator is None: - self.generator = self.event_handler_function(data_json, self) + self.generator = self.event_handler_function(data_json) try: response_anchor, response_data = next(self.generator) except StopIteration: