annotate display_issues_demo.py @ 20:3bb3d9a9f1b7

Filter by keywords and states. Configuration via configuration file. "No prio" grapf is displayed. (./display_issues_demo.py is not yet dynamic, it needs all states)
author Magnus Schieder <mschieder@intevation.de>
date Mon, 22 Oct 2018 16:49:58 +0200
parents adca5b3780d2
children 7a523e13fcb3
rev   line source
3
99c68ebfb3b9 Streamlined to example use.
Bernhard Reiter <bernhard@intevation.de>
parents:
diff changeset
1 #!/usr/bin/env python3
99c68ebfb3b9 Streamlined to example use.
Bernhard Reiter <bernhard@intevation.de>
parents:
diff changeset
2
99c68ebfb3b9 Streamlined to example use.
Bernhard Reiter <bernhard@intevation.de>
parents:
diff changeset
3 """ Fetch issues from a roundup-tracker and save them in a databse.
99c68ebfb3b9 Streamlined to example use.
Bernhard Reiter <bernhard@intevation.de>
parents:
diff changeset
4
99c68ebfb3b9 Streamlined to example use.
Bernhard Reiter <bernhard@intevation.de>
parents:
diff changeset
5 author: Sascha L. Teichmann <sascha.teichmann@intevation.de>
99c68ebfb3b9 Streamlined to example use.
Bernhard Reiter <bernhard@intevation.de>
parents:
diff changeset
6 author: Bernhard Reiter <bernhard@intevation.de>
99c68ebfb3b9 Streamlined to example use.
Bernhard Reiter <bernhard@intevation.de>
parents:
diff changeset
7 author: Sean Engelhardt <sean.engelhardt@intevation.de>
99c68ebfb3b9 Streamlined to example use.
Bernhard Reiter <bernhard@intevation.de>
parents:
diff changeset
8
17
adca5b3780d2 Add collecting no-prio issues. Restructure.
Bernhard Reiter <bernhard@intevation.de>
parents: 13
diff changeset
9 (c) 2010, 2015, 2018 by Intevation GmbH
3
99c68ebfb3b9 Streamlined to example use.
Bernhard Reiter <bernhard@intevation.de>
parents:
diff changeset
10
99c68ebfb3b9 Streamlined to example use.
Bernhard Reiter <bernhard@intevation.de>
parents:
diff changeset
11 This is Free Software unter the terms of the
99c68ebfb3b9 Streamlined to example use.
Bernhard Reiter <bernhard@intevation.de>
parents:
diff changeset
12 GNU GENERAL PUBLIC LICENSE Version 3 or later.
99c68ebfb3b9 Streamlined to example use.
Bernhard Reiter <bernhard@intevation.de>
parents:
diff changeset
13 See http://www.gnu.org/licenses/gpl-3.0.txt for details
99c68ebfb3b9 Streamlined to example use.
Bernhard Reiter <bernhard@intevation.de>
parents:
diff changeset
14 """
20
3bb3d9a9f1b7 Filter by keywords and states.
Magnus Schieder <mschieder@intevation.de>
parents: 17
diff changeset
15 import configparser
3bb3d9a9f1b7 Filter by keywords and states.
Magnus Schieder <mschieder@intevation.de>
parents: 17
diff changeset
16 from display_issues import *
3
99c68ebfb3b9 Streamlined to example use.
Bernhard Reiter <bernhard@intevation.de>
parents:
diff changeset
17
20
3bb3d9a9f1b7 Filter by keywords and states.
Magnus Schieder <mschieder@intevation.de>
parents: 17
diff changeset
18 config = configparser.ConfigParser()
3bb3d9a9f1b7 Filter by keywords and states.
Magnus Schieder <mschieder@intevation.de>
parents: 17
diff changeset
19 config.read('config3.ini')
3bb3d9a9f1b7 Filter by keywords and states.
Magnus Schieder <mschieder@intevation.de>
parents: 17
diff changeset
20
3bb3d9a9f1b7 Filter by keywords and states.
Magnus Schieder <mschieder@intevation.de>
parents: 17
diff changeset
21 keywords = config.get("SEARCH", "Keywords", fallback="")
3bb3d9a9f1b7 Filter by keywords and states.
Magnus Schieder <mschieder@intevation.de>
parents: 17
diff changeset
22 status = config.get("SEARCH", "Status", fallback="")
3bb3d9a9f1b7 Filter by keywords and states.
Magnus Schieder <mschieder@intevation.de>
parents: 17
diff changeset
23 columns = config.get("SEARCH", "Columns", fallback="critical, urgent, bug, feature, wish")
3bb3d9a9f1b7 Filter by keywords and states.
Magnus Schieder <mschieder@intevation.de>
parents: 17
diff changeset
24 noPrio = config.get("SEARCH", "IncludeNoPrio", fallback=False)
3bb3d9a9f1b7 Filter by keywords and states.
Magnus Schieder <mschieder@intevation.de>
parents: 17
diff changeset
25 if noPrio:
3bb3d9a9f1b7 Filter by keywords and states.
Magnus Schieder <mschieder@intevation.de>
parents: 17
diff changeset
26 columns += ", None"
3
99c68ebfb3b9 Streamlined to example use.
Bernhard Reiter <bernhard@intevation.de>
parents:
diff changeset
27
99c68ebfb3b9 Streamlined to example use.
Bernhard Reiter <bernhard@intevation.de>
parents:
diff changeset
28 cgitb.enable() # (optional) HTML traceback to browser
17
adca5b3780d2 Add collecting no-prio issues. Restructure.
Bernhard Reiter <bernhard@intevation.de>
parents: 13
diff changeset
29 #render_db_stats_as_html("./demo1.db", rcd.SELECT_ALL)
20
3bb3d9a9f1b7 Filter by keywords and states.
Magnus Schieder <mschieder@intevation.de>
parents: 17
diff changeset
30 render_db_stats_as_html("./demo3.db",
3bb3d9a9f1b7 Filter by keywords and states.
Magnus Schieder <mschieder@intevation.de>
parents: 17
diff changeset
31 rcd.build_sql_select(columns).format("timestamp > date('now', '-2 month')"),
3bb3d9a9f1b7 Filter by keywords and states.
Magnus Schieder <mschieder@intevation.de>
parents: 17
diff changeset
32 status, keywords)
This site is hosted by Intevation GmbH (Datenschutzerklärung und Impressum | Privacy Policy and Imprint)