more tweaks

This commit is contained in:
Brian Warner 2017-03-15 08:43:25 +01:00
parent 4f1b352b2a
commit ae95948c17
7 changed files with 14 additions and 21 deletions

View File

@ -21,7 +21,7 @@ digraph {
S1A -> P_allocate [label="connected" color="orange"]
S1B -> P_allocated [label="rx_allocated" color="orange"]
P_allocated [shape="box" label="C.allocated" color="orange"]
P_allocated [shape="box" label="C.allocated_nameplate" color="orange"]
P_allocated -> S2 [color="orange"]
S2 [label="S2:\ndone" color="orange"]

View File

@ -15,7 +15,7 @@ digraph {
label="C.input_code\n or C.allocate_code\n or C.set_code"]
P0_code -> S0
S0 [label="S0: empty"]
S0 -> P0_build [label="set_code"]
S0 -> P0_build [label="got_code"]
S0 -> P_close_error [label="rx_error"]
P_close_error [shape="box" label="T.close(errory)"]

View File

@ -44,8 +44,8 @@ class Allocator(object):
def RC_tx_allocate(self):
self._RC.tx_allocate()
@m.output()
def C_allocated(self, nameplate):
self._C.allocated(nameplate)
def C_allocated_nameplate(self, nameplate):
self._C.allocated_nameplate(nameplate)
S0A_idle.upon(connected, enter=S0B_idle_connected, outputs=[])
S0B_idle_connected.upon(lost, enter=S0A_idle, outputs=[])
@ -59,7 +59,7 @@ class Allocator(object):
S1B_allocating_connected.upon(lost, enter=S1A_allocating, outputs=[])
S1B_allocating_connected.upon(rx_allocated, enter=S2_done,
outputs=[C_allocated])
outputs=[C_allocated_nameplate])
S2_done.upon(connected, enter=S2_done, outputs=[])
S2_done.upon(lost, enter=S2_done, outputs=[])

View File

@ -62,11 +62,11 @@ class Boss(object):
self._O.wire(self._K, self._R)
self._K.wire(self, self._M, self._R)
self._R.wire(self, self._S)
self._RC.wire(self, self._N, self._M, self._C, self._L, self._T)
self._RC.wire(self, self._N, self._M, self._A, self._L, self._T)
self._L.wire(self._RC, self._I)
self._A.wire(self._RC, self._C)
self._I.wire(self._C, self._L)
self._C.wire(self, self._RC, self._L)
self._C.wire(self, self._A, self._N, self._K, self._I)
self._T.wire(self, self._RC, self._N, self._M)
self._did_start_code = False
@ -195,7 +195,6 @@ class Boss(object):
@m.output()
def do_got_code(self, code):
self._K.got_code(code)
self._W.got_code(code)
@m.output()
def process_version(self, plaintext):

View File

@ -30,8 +30,10 @@ class Code(object):
def wire(self, boss, rendezvous_connector, lister):
self._B = _interfaces.IBoss(boss)
self._RC = _interfaces.IRendezvousConnector(rendezvous_connector)
self._L = _interfaces.ILister(lister)
self._A = _interfaces.IAllocator(allocator)
self._N = _interfaces.INameplate(nameplate)
self._K = _interfaces.IKey(key)
self._I = _interfaces.IInput(input)
@m.state(initial=True)
def S0A_unknown(self): pass # pragma: no cover
@ -58,14 +60,6 @@ class Code(object):
@m.input()
def set_code(self, code): pass
# from RendezvousConnector
@m.input()
def connected(self): pass
@m.input()
def lost(self): pass
@m.input()
def rx_allocated(self, nameplate): pass
# from Lister
@m.input()
def got_nameplates(self, nameplates): pass

View File

@ -45,7 +45,7 @@ class Input(object):
@m.input()
def got_wordlist(self, wordlist): pass
# from CodeInputHelper
# API provided to app as ICodeInputHelper
@m.input()
def refresh_nameplates(self): pass
@m.input()

View File

@ -93,11 +93,11 @@ class RendezvousConnector(object):
return self._tor_manager.get_endpoint_for(hostname, port)
return endpoints.HostnameEndpoint(self._reactor, hostname, port)
def wire(self, boss, nameplate, mailbox, code, lister, terminator):
def wire(self, boss, nameplate, mailbox, allocator, lister, terminator):
self._B = _interfaces.IBoss(boss)
self._N = _interfaces.INameplate(nameplate)
self._M = _interfaces.IMailbox(mailbox)
self._C = _interfaces.ICode(code)
self._A = _interfaces.IAllocator(allocator)
self._L = _interfaces.ILister(lister)
self._T = _interfaces.ITerminator(terminator)