from pysqlite2 import dbapi2 as sqlite from databases import mysql as MySQLdb db = MySQLdb.connect("localhost","o","o","o_graphs") dbr = db
def _reconnect(self): self._db = MySQLdb.connect(**self._kw)
# This Source Code Form is subject to the terms of the Mozilla Public # License, v. 2.0. If a copy of the MPL was not distributed with this file, # You can obtain one at http://mozilla.org/MPL/2.0/. from graphsdb import amo_db_auth, db from databases import mysql as MySQLdb import csv amo_db = MySQLdb.connect(*amo_db_auth) class ParseError(Exception): pass appversions_aliases = { 'Firefox': 'fx', } def get_appversions_id(app_name, version): app_name = appversions_aliases.get(app_name, app_name) cur = amo_db.cursor() cur.execute("""\ SELECT id FROM perf_appversions WHERE app = %s AND version = %s """, (app_name, version)) row = cur.fetchone() if row is not None: return row[0] cur = amo_db.cursor() cur.execute("""\ INSERT INTO perf_appversions
# This Source Code Form is subject to the terms of the Mozilla Public # License, v. 2.0. If a copy of the MPL was not distributed with this file, # You can obtain one at http://mozilla.org/MPL/2.0/. from graphsdb import amo_db_auth, db from databases import mysql as MySQLdb import csv amo_db = MySQLdb.connect(*amo_db_auth) class ParseError(Exception): pass appversions_aliases = { 'Firefox': 'fx', } def get_appversions_id(app_name, version): app_name = appversions_aliases.get(app_name, app_name) cur = amo_db.cursor() cur.execute( """\ SELECT id FROM perf_appversions WHERE app = %s AND version = %s """, (app_name, version)) row = cur.fetchone() if row is not None: return row[0] cur = amo_db.cursor()
from pysqlite2 import dbapi2 as sqlite from databases import mysql as MySQLdb db = MySQLdb.connect("localhost", "o", "o", "o_graphs") dbr = db