view display_issues_demo.py @ 24:89469aa41fe1

Preliminary work to make the display more dynamic. * The values are now dynamically read from the database and written to a dynamic dict. * If "None" (NoPrio) is not existent it is set to [0] because the JS expects a value.
author Magnus Schieder <mschieder@intevation.de>
date Fri, 02 Nov 2018 17:06:45 +0100
parents 7a523e13fcb3
children 7161ce4e7ab1
line wrap: on
line source
#!/usr/bin/env python3

""" Fetch issues from a roundup-tracker and save them in a databse.

author: Sascha L. Teichmann <sascha.teichmann@intevation.de>
author: Bernhard Reiter <bernhard@intevation.de>
author: Sean Engelhardt <sean.engelhardt@intevation.de>

(c) 2010, 2015, 2018 by Intevation GmbH

This is Free Software unter the terms of the
GNU GENERAL PUBLIC LICENSE Version 3 or later.
See http://www.gnu.org/licenses/gpl-3.0.txt for details
"""
import configparser
import argparse
from display_issues import *

parser = argparse.ArgumentParser()
parser.add_argument("config_file", type=str, metavar="[config file]")
args = parser.parse_args()

config = configparser.ConfigParser()
config.read(args.config_file)

db = config.get("DB", "DatabaseFile")
keywords = config.get("SEARCH", "Keywords", fallback="")
status = config.get("SEARCH", "Status", fallback="")
columns = config.get("SEARCH", "Columns", fallback="critical, urgent, bug, feature, wish")
noPrio = config.get("SEARCH", "IncludeNoPrio", fallback=False)
if noPrio:
    columns += ", None"

cgitb.enable() # (optional) HTML traceback to browser
#render_db_stats_as_html("./demo1.db", rcd.SELECT_ALL)
render_db_stats_as_html(db,
        rcd.build_sql_select(columns).format("timestamp > date('now', '-2 month')"),
        columns, status, keywords)
This site is hosted by Intevation GmbH (Datenschutzerklärung und Impressum | Privacy Policy and Imprint)