Skip to content

Commit c739d2d

Browse files
committed
minor improvements to the file listing
1 parent fe9086b commit c739d2d

File tree

1 file changed

+7
-3
lines changed

1 file changed

+7
-3
lines changed

qtp_job_output_folder/summary.py

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
# The full license is in the file LICENSE, distributed with this software.
77
# -----------------------------------------------------------------------------
88

9-
from os.path import exists, isdir, join
9+
from os.path import exists, isdir, join, dirname
1010
from glob import glob
1111
from json import dumps
1212

@@ -26,11 +26,15 @@ def _generate_html_summary(jid, folder, out_dir):
2626
summary = f'<h3><b>{folder}</b> does not exist.</h3>'
2727

2828
if exists(folder) and isdir(folder):
29+
# calculating the "trimming" for the fullpaths, +1 is to remove /
30+
tname = len(dirname(folder)) + 1
31+
tlink = len(dirname(dirname(folder)))
2932
summary = '<br/>\n'.join([
30-
f'<a href="{f}" type="{ft}" target="_blank">{f}</a>'
33+
f'<a href=".{f[tlink:]}" type="{ft}" target="_blank">'
34+
f'{f[tname:]}</a>'
3135
for ft, f in _folder_listing(folder)])
3236

33-
index_fp = join(out_dir, f"summary_{jid}.html")
37+
index_fp = join(out_dir, f"summary.html")
3438
with open(index_fp, 'w') as of:
3539
of.write(summary)
3640

0 commit comments

Comments
 (0)