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