-
Notifications
You must be signed in to change notification settings - Fork 0
/
montest.py
executable file
·37 lines (29 loc) · 970 Bytes
/
montest.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
#!/usr/bin/python -i
"""
Monitor python console interface,
use this to replace the hexloader.
"""
from spork.lib.monitor.serial_link import MonInterface
from spork.lib.monitor.mon_firm import MonitorFirm
from spork.lib.monitor.commands import CommandList
from rich import print
import sys
if __name__ == "__main__":
import argparse
parser = argparse.ArgumentParser()
parser.add_argument("-f", "--firmware", action="store_true")
parser.add_argument("-l", "--list", action="store_true")
args = parser.parse_args()
if args.list or args.firmware:
import fwtest
spork = fwtest.build(MonitorFirm, detail=False)
if args.list:
print(spork.fw.code())
else:
if args.firmware:
from spork.upload import Uploader
up = Uploader()
up.upload(spork, console=False)
# m = MonInterface()
mon = CommandList()
mon # show the commands