Commit 787ba85c authored by Vincent Pelletier's avatar Vincent Pelletier

Re-introduce --js and --js-embed when pkg_resource is available.

parent 0164c5bd
- use some templating system instead of hardcoded html strings
- allow user to specify min & max dates
- implement --js & --js-embed even when pkg_resource is available
- move all N_* constants into command line arguments
- graph annotations
......@@ -875,8 +875,8 @@ def asHTML(out, encoding, per_site, args, default_site, period_parameter_dict,
graph_coefficient = period_parameter_dict['graph_coefficient']
out.write('<!DOCTYPE html>\n<html><head><meta charset="%s">'
'<title>Stats</title>' % encoding)
js_embed = getattr(args, 'js_embed', True)
js_path = getattr(args, 'js', None)
js_embed = getattr(args, 'js_embed', js_path is None)
if js_embed:
out.write('<style>')
out.write(getResource('apachedex.css'))
......@@ -1038,13 +1038,10 @@ def main():
group.add_argument('-s', '--stats', action='store_true',
help='Enable parsing stats (time spent parsing input, time spent '
'generating output, ...)')
if abs_file_container is not None:
# Force embedding when file container is unknown (ex: pkg_resources).
# XXX: allow when --js is also provided ?
group.add_argument('--js', default=abs_file_container,
help='Folder containing needed js files. Default: %(default)s')
group.add_argument('--js-embed', action='store_true',
help='Embed js files instead of linking to them.')
group.add_argument('--js', default=abs_file_container,
help='Folder containing needed js files. Default: %(default)s')
group.add_argument('--js-embed', action='store_true',
help='Embed js files instead of linking to them.')
group = parser.add_argument_group('site matching', 'Earlier arguments take '
'precedence. For example: --skip-base "/foo/bar(/|$|\\?)" '
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment