Skip to content

Commit

Permalink
Update footer
Browse files Browse the repository at this point in the history
  • Loading branch information
Bo Peng committed Jun 7, 2018
1 parent 64d5960 commit 6853e5f
Show file tree
Hide file tree
Showing 4 changed files with 24 additions and 10 deletions.
7 changes: 6 additions & 1 deletion src/sos/report.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,15 @@
# Copyright (c) Bo Peng and the University of Texas MD Anderson Cancer Center
# Distributed under the terms of the 3-clause BSD License.

import getpass
import os
import time
import base64
from collections import defaultdict
from contextlib import contextmanager

from .utils import TimeoutInterProcessLock, env, format_duration, dot_to_gif

from ._version import __version__

@contextmanager
def workflow_report(mode='a'):
Expand Down Expand Up @@ -125,6 +126,10 @@ def render_report(output_file, workflow_id):
'workflows': data.workflows(),
'tasks': data.tasks(),
'steps': data.steps(),
'sos_version': __version__,
'user': getpass.getuser(),
'time_now_str': time.strftime(
'%Y-%m-%d %H:%M:%S', time.localtime()),
}
# derived context
context['master_id'] = next(
Expand Down
23 changes: 16 additions & 7 deletions src/sos/templates/workflow_report.css
Original file line number Diff line number Diff line change
Expand Up @@ -17,16 +17,13 @@ html {

footer {
position: absolute;
margin-left: 20px;
margin-top: 10px;
left: 0;
bottom: 0;
height: 3em;
width: 80%;
width: 100%;
padding-top: 1em;
border-top-color: lightgray;
border-top-style: solid;
border-top-width: thin;
padding-bottom: 1em;
padding-left: 25px;
background-color: #f5f5f5;
overflow: hidden;
}

Expand Down Expand Up @@ -157,3 +154,15 @@ tbody tr:hover {
.subworkflow th {
font-style: normal;
}

footer a {
text-decoration: none;
}

footer a:link, a:visited {
color: black;
}

footer a:hover {
color: red;
}
2 changes: 1 addition & 1 deletion src/sos/templates/workflow_report.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -210,7 +210,7 @@
{% endif %}

<footer>
<a href="https://vatlab.github.io/sos-docs/">SoS Workflow Engine</a>
Report generated by <a href="https://vatlab.github.io/sos-docs/">SoS Workflow Engine</a> version {{sos_version}}, by {{ user }} on {{ time_now_str }}
</footer>
</body>
</html>
2 changes: 1 addition & 1 deletion src/sos/workflow_executor.py
Original file line number Diff line number Diff line change
Expand Up @@ -377,7 +377,7 @@ def __init__(self, workflow: Optional[SoS_Workflow] = None, args: Optional[Any]
if not env.config['master_id']:
env.config['master_id'] = self.md5
workflow_info['command_line'] = subprocess.list2cmdline(
[os.path.basename(sys.argv[0])] + sys.argv[1:]),
[os.path.basename(sys.argv[0])] + sys.argv[1:])
workflow_info['project_dir'] = os.getcwd()
workflow_info['master_id'] = env.config['master_id']
with workflow_report(mode='w' if env.config['master_id'] == self.md5 else 'a') as sig:
Expand Down

0 comments on commit 6853e5f

Please sign in to comment.