コード例 #1
0
from pysqlite2 import dbapi2 as sqlite
from databases import mysql as MySQLdb


db = MySQLdb.connect("localhost","o","o","o_graphs")
dbr = db
コード例 #2
0
ファイル: graphsdb.py プロジェクト: mnoorenberghe/graphs
 def _reconnect(self):
     self._db = MySQLdb.connect(**self._kw)
コード例 #3
0
ファイル: collect_amo.py プロジェクト: mnoorenberghe/graphs
# 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
コード例 #4
0
 def _reconnect(self):
     self._db = MySQLdb.connect(**self._kw)
コード例 #5
0
# 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()
コード例 #6
0
from pysqlite2 import dbapi2 as sqlite
from databases import mysql as MySQLdb

db = MySQLdb.connect("localhost", "o", "o", "o_graphs")
dbr = db