-
Notifications
You must be signed in to change notification settings - Fork 6
/
Copy pathentry_script.py
55 lines (36 loc) · 1.42 KB
/
entry_script.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
53
54
55
import csv
import sys
def write_output_file():
'''
Writes a dummy output file using the python csv writer, update this
to accept as parameter the found trace links.
'''
with open('/output/links.csv', 'w') as csvfile:
writer = csv.writer(csvfile, delimiter=",", quotechar="\"", quoting=csv.QUOTE_MINIMAL)
fieldnames = ["id", "links"]
writer.writerow(fieldnames)
writer.writerow(["UC1", "L1, L34, L5"])
writer.writerow(["UC2", "L5, L4"])
if __name__ == "__main__":
'''
Entry point for the script
'''
if len(sys.argv) < 2:
print("Please provide an argument to indicate which matcher should be used")
exit(1)
match_type = 0
try:
match_type = int(sys.argv[1])
except ValueError as e:
print("Match type provided is not a valid number")
exit(1)
print(f"Hello world, running with matchtype {match_type}!")
# Read input low-level requirements and count them (ignore header line).
with open("/input/low.csv", "r") as inputfile:
print(f"There are {len(inputfile.readlines()) - 1} low-level requirements")
'''
This is where you should implement the trace level logic as discussed in the
assignment on Canvas. Please ensure that you take care to deliver clean,
modular, and well-commented code.
'''
write_output_file()