-
Notifications
You must be signed in to change notification settings - Fork 0
/
get_shares.py
35 lines (31 loc) · 1 KB
/
get_shares.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
import cerealizer
import sys
import os
import subprocess
def main():
if len(sys.argv) != 3:
raise Exception("Incorrect args")
main_dir = sys.argv[1]
method = sys.argv[2]
allfiles = []
for root, dirs, files in os.walk(main_dir):
#considering main dir has bunch of directories with each testing data
matched = []
if len(files) != 0:
for smallfile in files:
matched.append(os.path.join(root, smallfile))
allfiles.append(matched)
for metafiles in allfiles:
for single_filename in metafiles:
#print("single filename " + str(single_filename))
parser = single_filename.split("/")[-1]
parser = parser.split(".pdf")[0]
print(parser)
subprocess.call(
["./main.py",
str(5), str(2), str(2),
single_filename, 'new_version/' + str(parser) + ".hex",
method
])
if __name__ == "__main__":
main()