annotate modules/web_view/display_issues_techintern.py @ 47:190a81a60e7e tip

Update README G: changed README.txt
author Gernot Schulz <gernot@intevation.de>
date Sun, 07 Feb 2016 13:26:32 +0100
parents ba41c0fbd6e7
children
rev   line source
16
f89ad628f831 adding the renamed files
sean
parents:
diff changeset
1 #!/usr/bin/env python3
f89ad628f831 adding the renamed files
sean
parents:
diff changeset
2
f89ad628f831 adding the renamed files
sean
parents:
diff changeset
3 """ Fetch issues from a roundup-tracker and save them in a databse.
f89ad628f831 adding the renamed files
sean
parents:
diff changeset
4
f89ad628f831 adding the renamed files
sean
parents:
diff changeset
5 author: Sascha L. Teichmann <sascha.teichmann@intevation.de>
f89ad628f831 adding the renamed files
sean
parents:
diff changeset
6 author: Bernhard Reiter <bernhard@intevation.de>
f89ad628f831 adding the renamed files
sean
parents:
diff changeset
7 author: Sean Engelhardt <sean.engelhardt@intevation.de>
f89ad628f831 adding the renamed files
sean
parents:
diff changeset
8
f89ad628f831 adding the renamed files
sean
parents:
diff changeset
9 (c) 2010,2015 by Intevation GmbH
f89ad628f831 adding the renamed files
sean
parents:
diff changeset
10
f89ad628f831 adding the renamed files
sean
parents:
diff changeset
11 This is Free Software unter the terms of the
f89ad628f831 adding the renamed files
sean
parents:
diff changeset
12 GNU GENERAL PUBLIC LICENSE Version 3 or later.
f89ad628f831 adding the renamed files
sean
parents:
diff changeset
13 See http://www.gnu.org/licenses/gpl-3.0.txt for details
f89ad628f831 adding the renamed files
sean
parents:
diff changeset
14 """
f89ad628f831 adding the renamed files
sean
parents:
diff changeset
15
42
8935152f5e19 Remove roundup_cc fork; import from embedded roundup_cc clone
Gernot Schulz <gernot@intevation.de>
parents: 16
diff changeset
16 from sys import path
8935152f5e19 Remove roundup_cc fork; import from embedded roundup_cc clone
Gernot Schulz <gernot@intevation.de>
parents: 16
diff changeset
17 import os
8935152f5e19 Remove roundup_cc fork; import from embedded roundup_cc clone
Gernot Schulz <gernot@intevation.de>
parents: 16
diff changeset
18
8935152f5e19 Remove roundup_cc fork; import from embedded roundup_cc clone
Gernot Schulz <gernot@intevation.de>
parents: 16
diff changeset
19 path.append(
8935152f5e19 Remove roundup_cc fork; import from embedded roundup_cc clone
Gernot Schulz <gernot@intevation.de>
parents: 16
diff changeset
20 os.path.join(os.path.dirname(os.path.realpath(__file__)), 'roundup_cc')
8935152f5e19 Remove roundup_cc fork; import from embedded roundup_cc clone
Gernot Schulz <gernot@intevation.de>
parents: 16
diff changeset
21 )
8935152f5e19 Remove roundup_cc fork; import from embedded roundup_cc clone
Gernot Schulz <gernot@intevation.de>
parents: 16
diff changeset
22
8935152f5e19 Remove roundup_cc fork; import from embedded roundup_cc clone
Gernot Schulz <gernot@intevation.de>
parents: 16
diff changeset
23 from display_issues import *
16
f89ad628f831 adding the renamed files
sean
parents:
diff changeset
24
43
2e2981af7d2d Use bottledash-specific graph template
Gernot Schulz <gernot@intevation.de>
parents: 42
diff changeset
25 graph = os.path.dirname(os.path.realpath(__file__)) + '/bottledash_graph.html'
2e2981af7d2d Use bottledash-specific graph template
Gernot Schulz <gernot@intevation.de>
parents: 42
diff changeset
26
16
f89ad628f831 adding the renamed files
sean
parents:
diff changeset
27 def get_chart(target_div_name):
42
8935152f5e19 Remove roundup_cc fork; import from embedded roundup_cc clone
Gernot Schulz <gernot@intevation.de>
parents: 16
diff changeset
28 html_string = compile_db_stats_html(
8935152f5e19 Remove roundup_cc fork; import from embedded roundup_cc clone
Gernot Schulz <gernot@intevation.de>
parents: 16
diff changeset
29 rcd.DATABASE_TECH_INTERN,
45
8449509b7f6f Limit time frame of graph
Gernot Schulz <gernot@intevation.de>
parents: 43
diff changeset
30 rcd.SELECT_WHERE.format("timestamp > date('now', '-2 month')"),
43
2e2981af7d2d Use bottledash-specific graph template
Gernot Schulz <gernot@intevation.de>
parents: 42
diff changeset
31 graph
42
8935152f5e19 Remove roundup_cc fork; import from embedded roundup_cc clone
Gernot Schulz <gernot@intevation.de>
parents: 16
diff changeset
32 )
16
f89ad628f831 adding the renamed files
sean
parents:
diff changeset
33
f89ad628f831 adding the renamed files
sean
parents:
diff changeset
34 html_string = html_string.replace(
f89ad628f831 adding the renamed files
sean
parents:
diff changeset
35 'var d3jsInjectionTarget="X";', 'var d3jsInjectionTarget="' + target_div_name + '";')
f89ad628f831 adding the renamed files
sean
parents:
diff changeset
36
f89ad628f831 adding the renamed files
sean
parents:
diff changeset
37 return html_string
f89ad628f831 adding the renamed files
sean
parents:
diff changeset
38
46
ba41c0fbd6e7 Print HTML to stdout if called directly
Gernot Schulz <gernot@intevation.de>
parents: 45
diff changeset
39 if __name__ == '__main__':
ba41c0fbd6e7 Print HTML to stdout if called directly
Gernot Schulz <gernot@intevation.de>
parents: 45
diff changeset
40 print(get_chart('techintern'))
This site is hosted by Intevation GmbH (Datenschutzerklärung und Impressum | Privacy Policy and Imprint)