changeset 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 d0c439d1e833
files display_issues.py
diffstat 1 files changed, 5 insertions(+), 4 deletions(-) [+]
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"):
This site is hosted by Intevation GmbH (Datenschutzerklärung und Impressum | Privacy Policy and Imprint)