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