Created
April 17, 2023 05:43
-
-
Save pkutaj/88954a1ed2bcf5977e9be963c0bbbf4f to your computer and use it in GitHub Desktop.
SSAP-44.03-State-Machine-for-Log-Reducer9.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def get_action(line, cur_state, event): | |
try: | |
return TRANSITIONS[cur_state][event][0] | |
except KeyError: | |
print_header("ERROR") | |
print(f"Affected line:\n\n" | |
f'\t>>> {line}\n' | |
f"The corresponding event '{event}' is not available for cur_state '{cur_state}'\n") | |
exit("~~> the input file seems malformed; Fix and try again.") |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment