summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorStuart Monteith <stuart.monteith@linaro.org>2016-11-03 11:47:19 +0000
committerStuart Monteith <stuart.monteith@linaro.org>2016-11-03 11:49:04 +0000
commit4feb317baa0a5e116622573b9c5c624d5de70b4e (patch)
tree83ae202cedc8509d6c425a2a0d6f3e73729cc2c2
parent3230ac2c00331d6c08b4c4d3be36e955de5ce4e4 (diff)
Fix os path generation
Path concatentation not working correctly, add to other report generation.
-rwxr-xr-xjcstress-generate-html-report.py2
-rwxr-xr-xjcstress-report.py3
2 files changed, 3 insertions, 2 deletions
diff --git a/jcstress-generate-html-report.py b/jcstress-generate-html-report.py
index a5c09b4..2a2ce13 100755
--- a/jcstress-generate-html-report.py
+++ b/jcstress-generate-html-report.py
@@ -54,7 +54,7 @@ with open(args.results, 'rb') as csvfile:
pass_fail = pass_fail_rate("{}/results/index.html".format(row[1]))
human_readable_date = time.strftime("%Y-%m-%d", time.localtime(int(row[0]))).lower()
html_row <= TD(human_readable_date)
- index_html = os.path.join(args.sub_dir, os.path.sep, remove_starting_path(row[1], args.top_dir), 'results', 'index.html')
+ index_html = os.path.join(args.sub_dir, remove_starting_path(row[1], args.top_dir), 'results', 'index.html')
html_row <= TD(A("{}/{}".format(pass_fail[0], pass_fail[1]), href=index_html), align='right')
table <= html_row
diff --git a/jcstress-report.py b/jcstress-report.py
index ba71a7d..b9e0f68 100755
--- a/jcstress-report.py
+++ b/jcstress-report.py
@@ -33,6 +33,7 @@ def remove_starting_path(full_path, start):
parser = argparse.ArgumentParser()
parser.add_argument('--results', help='results filename', type=str, required=True)
parser.add_argument('--top-dir', help="top directory", type=str, required=True)
+parser.add_argument('sub_dir', help="html subdirectory", type=str)
args = parser.parse_args()
with open(args.results, 'rb') as csvfile:
@@ -40,7 +41,7 @@ with open(args.results, 'rb') as csvfile:
for row in rdr:
human_readable_date = time.strftime("%Y-%m-%d", time.localtime(int(row[0]))).lower()
human_readable_index = os.path.join(remove_starting_path(row[1], args.top_dir), 'results')
- index_html = os.path.join(os.path.sep, remove_starting_path(row[1], args.top_dir), 'results', 'index.html')
+ index_html = os.path.join(args.sub_dir, remove_starting_path(row[1], args.top_dir), 'results', 'index.html')
html_row = TR()
html_row <= TD(human_readable_date)
html_row <= TD(A(human_readable_index, href=index_html))