Mercurial > roundup-cc
diff display_issues.py @ 14:b5f7a439bddd
Allow to override default graph.html file
author | Gernot Schulz <gernot@intevation.de> |
---|---|
date | Sun, 31 Jan 2016 15:41:35 +0100 |
parents | 149d01f43e31 |
children | adca5b3780d2 |
line wrap: on
line diff
--- a/display_issues.py Sun Jan 31 13:15:08 2016 +0100 +++ b/display_issues.py Sun Jan 31 15:41:35 2016 +0100 @@ -40,9 +40,10 @@ return ", ".join(formated) -def get_webpage(): +def get_webpage(graph=None): - graph = os.path.dirname(os.path.realpath(__file__)) + '/graph.html' + if graph is None: + graph = os.path.dirname(os.path.realpath(__file__)) + '/graph.html' with open(graph, "r") as html_chart_file: base_html_data = html_chart_file.read() @@ -57,7 +58,7 @@ return base_html_data -def compile_db_stats_html(db_file, sql_select): +def compile_db_stats_html(db_file, sql_select, graph=None): con = None cur = None @@ -80,7 +81,7 @@ if con: con.close() - return get_webpage() + return get_webpage(graph) def render_webpage(content): for line in content.split("\n"):