-
Notifications
You must be signed in to change notification settings - Fork 1
/
make.py
32 lines (25 loc) · 906 Bytes
/
make.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
with open('micropycelium/Packager.py', 'r') as f:
packager_src = f.readlines()
with open('micropycelium/Beacon.py', 'r') as f:
beacon_src = f.readlines()
with open('micropycelium/ESPNowInterface.py', 'r') as f:
espnowintrfc_src = f.readlines()
# discard all import lines from Beacon and ESPNowInterface
last_import = 0
for i in range(len(beacon_src)):
line = beacon_src[i]
if 'import' in line:
last_import = i
beacon_src = beacon_src[last_import+1:]
last_import = 0
for i in range(len(espnowintrfc_src)):
line = espnowintrfc_src[i]
if 'import' in line:
last_import = i
espnowintrfc_src = espnowintrfc_src[last_import+1:]
# turn on debug
for i in range(len(packager_src)):
if packager_src[i][:5] == 'DEBUG':
packager_src[i] = packager_src[i].replace('False', 'True')
break
print(''.join([*packager_src, *beacon_src, *espnowintrfc_src]))