-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathgenerate_output.py
More file actions
57 lines (53 loc) · 1.15 KB
/
generate_output.py
File metadata and controls
57 lines (53 loc) · 1.15 KB
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
56
57
import sys
head = """
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>Tendrl API coverage</title>
<script type='text/javascript' src="js/sorttable.js"></script>
<style type="text/css">
/* Sortable tables */
table.sortable thead {
background-color:#eee;
color:#666666;
font-weight: bold;
cursor: default;
}
.red {
background-color:#FA8072;
}
.green {
background-color:#7CFC00;
}
</style>
</head>
<body>
<div style="margin:10px">
<h1>API call coverage</h1>
<table class="sortable">
"""
print(head)
first = True
for line in sys.stdin:
if first:
print("<thead>")
print("<tr><td>" + "</td><td>".join(line.split(",")) + "</td></tr>")
print("</thead>")
first = False
print("<tbody>")
else:
row = "".join(["</td><td class='green'>" + x if x.strip() == "Yes"
else "</td><td class='red'>" + x if x.strip() == "No"
else "</td><td>" + x
for x in line.split(",")]) + "</td></tr>"
row = "<tr>" + row[5:]
print(row)
print("</tbody>")
tail = """
</table>
</div>
</body>
</html>
"""
print(tail)