starting to draw new state machines

This commit is contained in:
Brian Warner 2016-06-03 22:32:40 -07:00
parent 578522ae0f
commit 94b1ed8739
3 changed files with 30 additions and 0 deletions

1
.gitignore vendored
View File

@ -59,3 +59,4 @@ target/
/relay.sqlite
/misc/node_modules/
/docs/events.png
/docs/states-code.png

18
docs/states-code.dot Normal file
View 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
View File

@ -0,0 +1,11 @@
from automat import MethodicalMachine
class WormholeState(object):
_machine = MethodicalMachine()
@_machine.state(initial=True)
def start(self):
pass