summaryrefslogtreecommitdiff
path: root/tools
diff options
context:
space:
mode:
authorDaniel Thompson <daniel@redfelineninja.org.uk>2020-03-22 12:37:19 (GMT)
committerDaniel Thompson <daniel@redfelineninja.org.uk>2020-03-22 12:37:19 (GMT)
commitf8bd1a74613a79cad56b5b60079402d40a87d131 (patch)
treea0ac41ef104c8a39375357e2d730d16b9602f86d /tools
parent5a234c16ada5319228fd2231957ca64d2c9141f8 (diff)
Rename manager.py and expose its interfaces to all applications
This is a big change that break compatiblity with existing applications *and* with existing installed versions of main.py. When upgrading it is import to update main.py: ./tools/wasptool --upload wasp/main.py
Diffstat (limited to 'tools')
-rwxr-xr-xtools/wasptool15
1 files changed, 13 insertions, 2 deletions
diff --git a/tools/wasptool b/tools/wasptool
index 72e88bc..e546016 100755
--- a/tools/wasptool
+++ b/tools/wasptool
@@ -14,6 +14,11 @@ import string
import sys
def sync(c):
+ """Stop the watch and synchronize with the command prompt.
+
+ Sending a random print ensure the final export (of the prompt)
+ does not accidentally match a previously issued prompt.
+ """
tag = ''.join([random.choice(string.ascii_uppercase) for i in range(6)])
c.send('\x03')
@@ -23,8 +28,14 @@ def sync(c):
c.expect('>>> ')
def unsync(c):
- # Set the watch running again
- c.sendline('wasp.run()')
+ """Set the watch running again.
+
+ There must be an expect (or a sleep) since if we kill the subordinate
+ process too early then the sendline will not have completed.
+ """
+ c.sendline('wasp.system.run()')
+ c.expect('Watch is running, use Ctrl-C to stop')
+ c.send('\x18')
def paste(c, f, verbose=False):
docstring = False