mirror of
https://github.com/avatao-content/baseimage-tutorial-framework
synced 2024-11-22 13:51:33 +00:00
Give Button states boring names
This commit is contained in:
parent
23bef68f51
commit
d916f5bc65
@ -2,20 +2,19 @@ from transitions import Machine
|
|||||||
|
|
||||||
import event_handler_connector
|
import event_handler_connector
|
||||||
|
|
||||||
|
|
||||||
class Buttons:
|
class Buttons:
|
||||||
states = ['ayy', 'bee', 'cee']
|
states = ['A', 'B', 'C']
|
||||||
transitions = [
|
transitions = [
|
||||||
{'trigger': 'anchor_a', 'source': 'ayy', 'dest': 'bee'},
|
{'trigger': 'anchor_a', 'source': 'A', 'dest': 'B'},
|
||||||
{'trigger': 'anchor_b', 'source': 'bee', 'dest': 'cee'},
|
{'trigger': 'anchor_b', 'source': 'B', 'dest': 'C'},
|
||||||
{'trigger': 'anchor_c', 'source': 'cee', 'dest': 'ayy'},
|
{'trigger': 'anchor_c', 'source': 'C', 'dest': 'A'},
|
||||||
]
|
]
|
||||||
|
|
||||||
def __init__(self):
|
def __init__(self):
|
||||||
self.machine = Machine(model=self,
|
self.machine = Machine(model=self,
|
||||||
states=Buttons.states,
|
states=Buttons.states,
|
||||||
transitions=Buttons.transitions,
|
transitions=Buttons.transitions,
|
||||||
initial='ayy',
|
initial='A',
|
||||||
send_event=True,
|
send_event=True,
|
||||||
ignore_invalid_triggers=True,
|
ignore_invalid_triggers=True,
|
||||||
after_state_change='forward_message')
|
after_state_change='forward_message')
|
||||||
|
Loading…
Reference in New Issue
Block a user