mirror of
https://github.com/avatao-content/baseimage-tutorial-framework
synced 2024-11-22 07:51:32 +00:00
Remove passing self to event handler functions
This commit is contained in:
parent
277ad85735
commit
895a387169
@ -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))
|
||||
|
||||
|
@ -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:
|
||||
|
Loading…
Reference in New Issue
Block a user