annotate modules/roundup_cc/roundup_content_data/__init__.py @ 17:09e3c38a7802

removing the old template cause of an ambiguous name
author sean
date Wed, 05 Aug 2015 13:36:26 +0200
parents 7a573ec679a6
children
rev   line source
11
7a573ec679a6 added more files, can now display charts a bit
sean
parents:
diff changeset
1 #!/usr/bin/env python
7a573ec679a6 added more files, can now display charts a bit
sean
parents:
diff changeset
2
7a573ec679a6 added more files, can now display charts a bit
sean
parents:
diff changeset
3 """ supplys the data needed to comunicate with the roundup-server,
7a573ec679a6 added more files, can now display charts a bit
sean
parents:
diff changeset
4 and the sqlite database. Represents the types of errors used in roundup.
7a573ec679a6 added more files, can now display charts a bit
sean
parents:
diff changeset
5
7a573ec679a6 added more files, can now display charts a bit
sean
parents:
diff changeset
6 author: Sascha L. Teichmann <sascha.teichmann@intevation.de>
7a573ec679a6 added more files, can now display charts a bit
sean
parents:
diff changeset
7 author: Bernhard Reiter <bernhard@intevation.de>
7a573ec679a6 added more files, can now display charts a bit
sean
parents:
diff changeset
8 author: Sean Engelhardt <sean.engelhardt@intevation.de>
7a573ec679a6 added more files, can now display charts a bit
sean
parents:
diff changeset
9
7a573ec679a6 added more files, can now display charts a bit
sean
parents:
diff changeset
10 (c) 2010,2015 by Intevation GmbH
7a573ec679a6 added more files, can now display charts a bit
sean
parents:
diff changeset
11
7a573ec679a6 added more files, can now display charts a bit
sean
parents:
diff changeset
12 This is Free Software unter the terms of the
7a573ec679a6 added more files, can now display charts a bit
sean
parents:
diff changeset
13 GNU GENERAL PUBLIC LICENSE Version 3 or later.
7a573ec679a6 added more files, can now display charts a bit
sean
parents:
diff changeset
14 See http://www.gnu.org/licenses/gpl-3.0.txt for details
7a573ec679a6 added more files, can now display charts a bit
sean
parents:
diff changeset
15 """
7a573ec679a6 added more files, can now display charts a bit
sean
parents:
diff changeset
16
7a573ec679a6 added more files, can now display charts a bit
sean
parents:
diff changeset
17 import os
7a573ec679a6 added more files, can now display charts a bit
sean
parents:
diff changeset
18
7a573ec679a6 added more files, can now display charts a bit
sean
parents:
diff changeset
19 #Add desired sqlite databases here
7a573ec679a6 added more files, can now display charts a bit
sean
parents:
diff changeset
20 DATABASE_REFERENCCE = os.path.dirname(os.path.realpath(__file__)) + "/test_reference.db"
7a573ec679a6 added more files, can now display charts a bit
sean
parents:
diff changeset
21 DATABASE_DEMO = os.path.dirname(os.path.realpath(__file__)) + "/demo.db"
7a573ec679a6 added more files, can now display charts a bit
sean
parents:
diff changeset
22 DATABASE_ERRORDB = os.path.dirname(os.path.realpath(__file__)) + "/errordatabase.db"
7a573ec679a6 added more files, can now display charts a bit
sean
parents:
diff changeset
23 DATABASE_TECH_INTERN = os.path.dirname(os.path.realpath(__file__)) + "/tech_intern.db"
7a573ec679a6 added more files, can now display charts a bit
sean
parents:
diff changeset
24 DATABASE_INT_TEST = os.path.dirname(os.path.realpath(__file__)) + "/int_test.db"
7a573ec679a6 added more files, can now display charts a bit
sean
parents:
diff changeset
25
7a573ec679a6 added more files, can now display charts a bit
sean
parents:
diff changeset
26 COLUMNS= [
7a573ec679a6 added more files, can now display charts a bit
sean
parents:
diff changeset
27 "critical", "urgent", "bug", "feature", "wish",
7a573ec679a6 added more files, can now display charts a bit
sean
parents:
diff changeset
28 ]
7a573ec679a6 added more files, can now display charts a bit
sean
parents:
diff changeset
29
7a573ec679a6 added more files, can now display charts a bit
sean
parents:
diff changeset
30 data_dict = {
7a573ec679a6 added more files, can now display charts a bit
sean
parents:
diff changeset
31 "date": [],
7a573ec679a6 added more files, can now display charts a bit
sean
parents:
diff changeset
32 "critical": [],
7a573ec679a6 added more files, can now display charts a bit
sean
parents:
diff changeset
33 "urgent": [],
7a573ec679a6 added more files, can now display charts a bit
sean
parents:
diff changeset
34 "bug": [],
7a573ec679a6 added more files, can now display charts a bit
sean
parents:
diff changeset
35 "feature": [],
7a573ec679a6 added more files, can now display charts a bit
sean
parents:
diff changeset
36 "wish": []
7a573ec679a6 added more files, can now display charts a bit
sean
parents:
diff changeset
37 }
7a573ec679a6 added more files, can now display charts a bit
sean
parents:
diff changeset
38
7a573ec679a6 added more files, can now display charts a bit
sean
parents:
diff changeset
39 #SQL
7a573ec679a6 added more files, can now display charts a bit
sean
parents:
diff changeset
40
7a573ec679a6 added more files, can now display charts a bit
sean
parents:
diff changeset
41 #DEMO System
7a573ec679a6 added more files, can now display charts a bit
sean
parents:
diff changeset
42 SELECT_ALL = """
7a573ec679a6 added more files, can now display charts a bit
sean
parents:
diff changeset
43 SELECT strftime("%Y-%m-%dT%H:%M:%S", timestamp),
7a573ec679a6 added more files, can now display charts a bit
sean
parents:
diff changeset
44 critical,
7a573ec679a6 added more files, can now display charts a bit
sean
parents:
diff changeset
45 urgent,
7a573ec679a6 added more files, can now display charts a bit
sean
parents:
diff changeset
46 bug,
7a573ec679a6 added more files, can now display charts a bit
sean
parents:
diff changeset
47 feature,
7a573ec679a6 added more files, can now display charts a bit
sean
parents:
diff changeset
48 wish
7a573ec679a6 added more files, can now display charts a bit
sean
parents:
diff changeset
49 FROM issues
7a573ec679a6 added more files, can now display charts a bit
sean
parents:
diff changeset
50 ORDER BY timestamp
7a573ec679a6 added more files, can now display charts a bit
sean
parents:
diff changeset
51 """
7a573ec679a6 added more files, can now display charts a bit
sean
parents:
diff changeset
52
7a573ec679a6 added more files, can now display charts a bit
sean
parents:
diff changeset
53
7a573ec679a6 added more files, can now display charts a bit
sean
parents:
diff changeset
54 CREATE_DB = """
7a573ec679a6 added more files, can now display charts a bit
sean
parents:
diff changeset
55 CREATE TABLE issues (
7a573ec679a6 added more files, can now display charts a bit
sean
parents:
diff changeset
56 timestamp TIMESTAMP NOT NULL UNIQUE DEFAULT current_timestamp,
7a573ec679a6 added more files, can now display charts a bit
sean
parents:
diff changeset
57 critical INTEGER NOT NULL DEFAULT 0,
7a573ec679a6 added more files, can now display charts a bit
sean
parents:
diff changeset
58 urgent INTEGER NOT NULL DEFAULT 0,
7a573ec679a6 added more files, can now display charts a bit
sean
parents:
diff changeset
59 bug INTEGER NOT NULL DEFAULT 0,
7a573ec679a6 added more files, can now display charts a bit
sean
parents:
diff changeset
60 feature INTEGER NOT NULL DEFAULT 0,
7a573ec679a6 added more files, can now display charts a bit
sean
parents:
diff changeset
61 wish INTEGER NOT NULL DEFAULT 0
7a573ec679a6 added more files, can now display charts a bit
sean
parents:
diff changeset
62 )
7a573ec679a6 added more files, can now display charts a bit
sean
parents:
diff changeset
63 """
7a573ec679a6 added more files, can now display charts a bit
sean
parents:
diff changeset
64
7a573ec679a6 added more files, can now display charts a bit
sean
parents:
diff changeset
65
7a573ec679a6 added more files, can now display charts a bit
sean
parents:
diff changeset
66 INSERT_NEW = """
7a573ec679a6 added more files, can now display charts a bit
sean
parents:
diff changeset
67 INSERT INTO issues (critical, urgent, bug, feature, wish)
7a573ec679a6 added more files, can now display charts a bit
sean
parents:
diff changeset
68 VALUES (?, ?, ?, ?, ?)
7a573ec679a6 added more files, can now display charts a bit
sean
parents:
diff changeset
69 """
7a573ec679a6 added more files, can now display charts a bit
sean
parents:
diff changeset
70
7a573ec679a6 added more files, can now display charts a bit
sean
parents:
diff changeset
71 #Referecen DB:
7a573ec679a6 added more files, can now display charts a bit
sean
parents:
diff changeset
72 SELECT_ALL_REFERENCE = """
7a573ec679a6 added more files, can now display charts a bit
sean
parents:
diff changeset
73 SELECT strftime("%Y-%m-%dT%H:%M:%S", sample_time),
7a573ec679a6 added more files, can now display charts a bit
sean
parents:
diff changeset
74 critical,
7a573ec679a6 added more files, can now display charts a bit
sean
parents:
diff changeset
75 major,
7a573ec679a6 added more files, can now display charts a bit
sean
parents:
diff changeset
76 crash,
7a573ec679a6 added more files, can now display charts a bit
sean
parents:
diff changeset
77 normal,
7a573ec679a6 added more files, can now display charts a bit
sean
parents:
diff changeset
78 minor,
7a573ec679a6 added more files, can now display charts a bit
sean
parents:
diff changeset
79 wishlist
7a573ec679a6 added more files, can now display charts a bit
sean
parents:
diff changeset
80 FROM issues
7a573ec679a6 added more files, can now display charts a bit
sean
parents:
diff changeset
81 ORDER BY sample_time
7a573ec679a6 added more files, can now display charts a bit
sean
parents:
diff changeset
82 """
This site is hosted by Intevation GmbH (Datenschutzerklärung und Impressum | Privacy Policy and Imprint)