-
Notifications
You must be signed in to change notification settings - Fork 144
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
acee544
commit ab99cc8
Showing
2 changed files
with
57 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
#!python3 | ||
# Generate index.html for code coverage pages | ||
|
||
from glob import iglob | ||
from base64 import urlsafe_b64encode, urlsafe_b64decode | ||
|
||
master_path = urlsafe_b64encode(b"master").decode("utf-8") | ||
|
||
print("<html><head><title>Code Coverage</title>") | ||
print("<style>body { font-size: 1.2em }</style>") | ||
print(f"</head><body><h1>Code coverage</h1>") | ||
print(f"<h2>Per branch (<a href=\"{master_path}/index.html\">master</a>)</h2><ul>") | ||
for path in sorted(list(iglob("*/index.html", recursive=True))): | ||
name = urlsafe_b64decode(path.split("/")[0].encode()).decode() | ||
style = "font-weight: bold" if name == "master" else "" | ||
print(f'<li style="{style}"><a href="{path}">{name}</a></li>') | ||
print("</ul></body></html>") |