sean@0: #!/usr/bin/env python sean@0: sean@0: """ supplys the data needed to comunicate with the roundup-server, sean@0: and the sqlite database. Represents the types of errors used in roundup. sean@0: sean@0: author: Sascha L. Teichmann sean@0: author: Bernhard Reiter sean@0: author: Sean Engelhardt sean@0: sean@0: (c) 2010,2015 by Intevation GmbH sean@0: sean@0: This is Free Software unter the terms of the sean@0: GNU GENERAL PUBLIC LICENSE Version 3 or later. sean@0: See http://www.gnu.org/licenses/gpl-3.0.txt for details sean@0: """ sean@0: sean@0: import os sean@0: sean@1: #Add desired sqlite databases here sean@1: DATABASE_REFERENCCE = os.path.dirname(os.path.realpath(__file__)) + "/test_reference.db" sean@1: DATABASE_DEMO = os.path.dirname(os.path.realpath(__file__)) + "/demo.db" sean@1: DATABASE_ERRORDB = os.path.dirname(os.path.realpath(__file__)) + "/errordatabase.db" sean@1: DATABASE_TECH_INTERN = os.path.dirname(os.path.realpath(__file__)) + "/tech_intern.db" sean@1: DATABASE_INT_TEST = os.path.dirname(os.path.realpath(__file__)) + "/int_test.db" sean@0: sean@1: COLUMNS= [ sean@0: "critical", "urgent", "bug", "feature", "wish", sean@0: ] sean@0: sean@0: data_dict = { sean@0: "date": [], sean@0: "critical": [], sean@0: "urgent": [], sean@0: "bug": [], sean@0: "feature": [], sean@0: "wish": [] sean@0: } sean@0: sean@1: #SQL sean@0: sean@1: #DEMO System sean@0: SELECT_ALL = """ sean@0: SELECT strftime("%Y-%m-%dT%H:%M:%S", timestamp), sean@0: critical, sean@0: urgent, sean@0: bug, sean@0: feature, sean@0: wish sean@0: FROM issues sean@0: ORDER BY timestamp sean@0: """ sean@0: sean@0: sean@0: CREATE_DB = """ sean@0: CREATE TABLE issues ( sean@0: timestamp TIMESTAMP NOT NULL UNIQUE DEFAULT current_timestamp, sean@0: critical INTEGER NOT NULL DEFAULT 0, sean@0: urgent INTEGER NOT NULL DEFAULT 0, sean@0: bug INTEGER NOT NULL DEFAULT 0, sean@0: feature INTEGER NOT NULL DEFAULT 0, sean@0: wish INTEGER NOT NULL DEFAULT 0 sean@0: ) sean@0: """ sean@0: sean@0: sean@0: INSERT_NEW = """ sean@0: INSERT INTO issues (critical, urgent, bug, feature, wish) sean@0: VALUES (?, ?, ?, ?, ?) sean@1: """ sean@1: sean@1: #Referecen DB: sean@1: SELECT_ALL_REFERENCE = """ sean@1: SELECT strftime("%Y-%m-%dT%H:%M:%S", sample_time), sean@1: critical, sean@1: major, sean@1: crash, sean@1: normal, sean@1: minor, sean@1: wishlist sean@1: FROM issues sean@1: ORDER BY sample_time sean@0: """