Merge pull request #13 from avatao-content/bottomless_pit

Refactor TFW architecture to support stateless event handling
This commit is contained in:
Bokros Bálint
2018-02-26 17:06:22 +01:00
committed by Kristóf Tóth
12 changed files with 132 additions and 86 deletions

View File

@ -6,7 +6,7 @@ from tfw.config import tfwenv
if __name__ == '__main__':
eventhandlers = {SourceCodeEventHandler('anchor_webide', tfwenv.WEBIDE_WD, 'login'),
eventhandlers = {SourceCodeEventHandler('anchor_webide', tfwenv.WEBIDE_WD),
TerminadoEventHandler('anchor_terminado', 'terminado')}
try:
IOLoop.instance().start()

View File

@ -12,13 +12,13 @@ class SQLInjectionFSM(FSMBase):
'end',
]
transitions = [
{'trigger': 'anchor_webide', 'source': '*', 'dest': 'stripped_code'}, # TODO: delet this
{'trigger': 'anchor_webide', 'source': 'start', 'dest': 'stripped_code'},
{'trigger': 'anchor_login', 'source': 'stripped_code', 'dest': 'sql'},
{'trigger': 'anchor_logger', 'source': 'sql', 'dest': 'commented_code'},
{'trigger': 'anchor_webide', 'source': 'commented_code', 'dest': 'sql_with_substitutions'},
{'trigger': 'anchor_logger', 'source': 'sql_with_substitutions', 'dest': 'sql_output'},
{'trigger': 'anchor_logger', 'source': 'sql_output', 'dest': 'end'},
{'trigger': 'webide', 'source': '*', 'dest': 'stripped_code'}, # TODO: delet this
{'trigger': 'webide', 'source': 'start', 'dest': 'stripped_code'},
{'trigger': 'login', 'source': 'stripped_code', 'dest': 'sql'},
{'trigger': 'logger', 'source': 'sql', 'dest': 'commented_code'},
{'trigger': 'webide', 'source': 'commented_code', 'dest': 'sql_with_substitutions'},
{'trigger': 'logger', 'source': 'sql_with_substitutions', 'dest': 'sql_output'},
{'trigger': 'logger', 'source': 'sql_output', 'dest': 'end'},
{'trigger': 'reset', 'source': 'end', 'dest': 'start'},
]