starting to draw new state machines
This commit is contained in:
parent
578522ae0f
commit
94b1ed8739
1
.gitignore
vendored
1
.gitignore
vendored
|
@ -59,3 +59,4 @@ target/
|
|||
/relay.sqlite
|
||||
/misc/node_modules/
|
||||
/docs/events.png
|
||||
/docs/states-code.png
|
||||
|
|
18
docs/states-code.dot
Normal file
18
docs/states-code.dot
Normal file
|
@ -0,0 +1,18 @@
|
|||
/* this state machine is just about the code */
|
||||
|
||||
digraph {
|
||||
need_code [label="need\ncode"]
|
||||
asking_for_code [label="asking\nuser\nfor\ncode"]
|
||||
creating_code [label="allocating\nnameplate"]
|
||||
creating_code2 [label="generating\nsecret"]
|
||||
know_code
|
||||
|
||||
need_code -> know_code [label="set_code()"]
|
||||
|
||||
need_code -> asking_for_code [label="input_code()"]
|
||||
asking_for_code -> know_code [label="user typed code"]
|
||||
|
||||
need_code -> creating_code [label="get_code()"]
|
||||
creating_code -> creating_code2 [label="rx allocation"]
|
||||
creating_code2 -> know_code [label="generated secret"]
|
||||
}
|
11
src/wormhole/states.py
Normal file
11
src/wormhole/states.py
Normal file
|
@ -0,0 +1,11 @@
|
|||
|
||||
from automat import MethodicalMachine
|
||||
|
||||
class WormholeState(object):
|
||||
_machine = MethodicalMachine()
|
||||
|
||||
@_machine.state(initial=True)
|
||||
def start(self):
|
||||
pass
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user