Remove passing self to event handler functions

This commit is contained in:
Bálint Bokros 2017-12-05 20:34:06 +01:00
parent 277ad85735
commit 895a387169
2 changed files with 3 additions and 3 deletions

View File

@ -28,7 +28,7 @@ def reverse_handler(data):
return data return data
def login_handler(data, component): def login_handler(data):
email, password = data['data']['email'], data['data']['password'] email, password = data['data']['email'], data['data']['password']
try: try:
sql_statement = source_code.find_local_variable_value(authorize_login, 'sql_statement') 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) yield ('anchor_login', '# Login page\n' + response)
def source_code_handler(data, event_handler): def source_code_handler(data):
yield (data['anchor'], yield (data['anchor'],
source_code.get_source_code(authorize_login, strip_comments=True)) source_code.get_source_code(authorize_login, strip_comments=True))

View File

@ -17,7 +17,7 @@ class StatefulEventHandler(EventHandlerBase):
return return
data_json = json.loads(message) data_json = json.loads(message)
if self.generator is None: if self.generator is None:
self.generator = self.event_handler_function(data_json, self) self.generator = self.event_handler_function(data_json)
try: try:
response_anchor, response_data = next(self.generator) response_anchor, response_data = next(self.generator)
except StopIteration: except StopIteration: