diff options
Diffstat (limited to 'tools')
| -rwxr-xr-x | tools/rle_encode.py | 3 | ||||
| -rwxr-xr-x | tools/wasptool | 19 |
2 files changed, 17 insertions, 5 deletions
diff --git a/tools/rle_encode.py b/tools/rle_encode.py index a938c76..60b2bdc 100755 --- a/tools/rle_encode.py +++ b/tools/rle_encode.py @@ -1,5 +1,8 @@ #!/usr/bin/env python3 +# SPDX-License-Identifier: LGPL-3.0-or-later +# Copyright (C) 2020 Daniel Thompson + import argparse import sys import os.path diff --git a/tools/wasptool b/tools/wasptool index 72e88bc..26018ab 100755 --- a/tools/wasptool +++ b/tools/wasptool @@ -1,9 +1,7 @@ #!/usr/bin/python3 -# -# SPDX-License-Identifier: MIT +# SPDX-License-Identifier: LGPL-3.0-or-later # Copyright (c) 2020 Daniel Thompson -# import argparse import random @@ -14,6 +12,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 +26,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 |
