# HG changeset patch # User sean # Date 1438696807 -7200 # Node ID 50f4c64834cbb08a55b69387fc77391d2496317c # Parent 7a573ec679a69524e59365fe1500043dff4ea5c3 delegation of dynamic charts works now diff -r 7a573ec679a6 -r 50f4c64834cb dash.conf --- a/dash.conf Tue Aug 04 14:23:53 2015 +0200 +++ b/dash.conf Tue Aug 04 16:00:07 2015 +0200 @@ -62,4 +62,4 @@ [tile4] type=d3js -status=modules/roundup-cc/display_issues._techintern.py +status=display_issues_techintern diff -r 7a573ec679a6 -r 50f4c64834cb modules/roundup_cc/__init__.py --- a/modules/roundup_cc/__init__.py Tue Aug 04 14:23:53 2015 +0200 +++ b/modules/roundup_cc/__init__.py Tue Aug 04 16:00:07 2015 +0200 @@ -14,8 +14,29 @@ See http://www.gnu.org/licenses/gpl-3.0.txt for details """ -import roundup_cc.display_issues as display -import roundup_cc.roundup_content_data as rcd +# import re +# import , os -def get_tech_intern_chart(): - return display.render_db_stats_as_html(rcd.DATABASE_TECH_INTERN, rcd.SELECT_ALL) +import importlib + +# from roundup_cc import * + +# PATH = os.path.dirname(os.path.abspath(inspect.getfile(inspect.currentframe()))) + +def make_chart(chart_data_file): + + mod = importlib.import_module("roundup_cc." + chart_data_file) + return mod.get_chart() + + # test = exec(open(PATH + "/" + chart_data_file+'.py').read()) + + # print(test) + # html = eval(chart_data_file+".py") + # return html + # fp = open(chart_data_file) + # contents = fp.read() + + # return exec(chart_data_file.get_chart() + +# def get_tech_intern_chart(): +# return display.render_db_stats_as_html(rcd.DATABASE_TECH_INTERN, rcd.SELECT_ALL) diff -r 7a573ec679a6 -r 50f4c64834cb modules/roundup_cc/display_issues.py --- a/modules/roundup_cc/display_issues.py Tue Aug 04 14:23:53 2015 +0200 +++ b/modules/roundup_cc/display_issues.py Tue Aug 04 16:00:07 2015 +0200 @@ -19,12 +19,12 @@ """ import sqlite3 as db -import cgitb, os, sys +import cgitb, os, sys, inspect import roundup_cc.roundup_content_data as rcd -PATH = os.path.abspath(os.path.dirname(sys.argv[0])) +PATH = os.path.dirname(os.path.abspath(inspect.getfile(inspect.currentframe()))) HTML_DATA = "graph.html" -PATH_TO_HTML = PATH + "/modules/roundup_cc/" + HTML_DATA +PATH_TO_HTML = PATH + "/" + HTML_DATA def make_js_object_string(array): formated = [] diff -r 7a573ec679a6 -r 50f4c64834cb modules/roundup_cc/graph.html --- a/modules/roundup_cc/graph.html Tue Aug 04 14:23:53 2015 +0200 +++ b/modules/roundup_cc/graph.html Tue Aug 04 16:00:07 2015 +0200 @@ -96,7 +96,11 @@ // }; var critical=[]; - + var urgent=[]; + var bug=[]; + var feature=[]; + var wish=[]; + var timestamp=[]; // var critical=[ // {points: 4}, @@ -141,8 +145,6 @@ // {date : new Date('2015-07-03T12:39:26')} // ] - - document.addEventListener("DOMContentLoaded", function(event) { makeChart(); }); diff -r 7a573ec679a6 -r 50f4c64834cb views/hello_template.tpl --- a/views/hello_template.tpl Tue Aug 04 14:23:53 2015 +0200 +++ b/views/hello_template.tpl Tue Aug 04 16:00:07 2015 +0200 @@ -195,8 +195,7 @@ elif tile["type"] == "d3js" : type = "chart" status = "" - text = roundup_cc.get_tech_intern_chart() - #text = "
HHOHOHOHOH
" + text = roundup_cc.make_chart(tile["status"]) end %>