mirror of
https://github.com/avatao-content/baseimage-tutorial-framework
synced 2024-11-05 10:21:21 +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
|
||||
|
||||
|
||||
class Buttons:
|
||||
states = ['ayy', 'bee', 'cee']
|
||||
states = ['A', 'B', 'C']
|
||||
transitions = [
|
||||
{'trigger': 'anchor_a', 'source': 'ayy', 'dest': 'bee'},
|
||||
{'trigger': 'anchor_b', 'source': 'bee', 'dest': 'cee'},
|
||||
{'trigger': 'anchor_c', 'source': 'cee', 'dest': 'ayy'},
|
||||
{'trigger': 'anchor_a', 'source': 'A', 'dest': 'B'},
|
||||
{'trigger': 'anchor_b', 'source': 'B', 'dest': 'C'},
|
||||
{'trigger': 'anchor_c', 'source': 'C', 'dest': 'A'},
|
||||
]
|
||||
|
||||
def __init__(self):
|
||||
self.machine = Machine(model=self,
|
||||
states=Buttons.states,
|
||||
transitions=Buttons.transitions,
|
||||
initial='ayy',
|
||||
initial='A',
|
||||
send_event=True,
|
||||
ignore_invalid_triggers=True,
|
||||
after_state_change='forward_message')
|
||||
|
Loading…
Reference in New Issue
Block a user