-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathtest_create_upload_files.py
52 lines (40 loc) · 1.5 KB
/
test_create_upload_files.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
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
#! /usr/bin/python3
import os
from argparse import ArgumentParser
from minify_write import write_minified
BOOT_FILE = "testing/test_iteration_speed_boot.py"
SOURCES_LIST = [
#"numac_porting/ax.py",
#"bioloid3/bus.py",
#"numac_porting/commander.py",
#"bioloid3/device.py",
#"bioloid3/dump_mem.py",
#"numac_porting/helpers.py",
#"numac_porting/init.py",
"numac_porting/IK.py",
#"bioloid3/log.py",
"testing/test_iteration_speed.py",
#"numac_porting/numa.py",
#"numac_porting/numa2.py",
#"bioloid3/packet.py",
#"bioloid3/scan.py",
#"bioloid3/serial_bus.py",
#"bioloid3/serial_port.py",
#"bioloid3/socket_port.py",
#"bioloid3/stm_uart_port.py",
#"bioloid3/stm_usb_port.py",
#"numac_porting/vecmath.py",
]
OUTPUT_FOLDER = "micropy-to-upload"
if __name__ == "__main__":
parser = ArgumentParser()
parser.add_argument("-f", "--full", action="store_true",
help="Don't minify produced files.")
args = parser.parse_args()
if not os.path.isdir("micropy-to-upload"):
os.mkdir("micropy-to-upload")
for filename in SOURCES_LIST:
newfile = os.path.join(OUTPUT_FOLDER, os.path.basename(filename))
write_minified(filename, newfile, not args.full)
newfile = os.path.join(OUTPUT_FOLDER, "boot.py")
write_minified(BOOT_FILE, newfile, not args.full)