view talosnames/api.py @ 1:a10ae1ea8325

WIP
author Jeff Hammel <jhammel@mozilla.com>
date Sun, 08 Jul 2012 10:09:51 -0700
parents 3e1f069ac608
children c98f2a383595
line wrap: on
line source

import sqlite3
import urllib2

class TalosNames(object):
    graphserver_sql = 'http://hg.mozilla.org/graphs/raw-file/tip/sql/data.sql'
    schema = 'http://hg.mozilla.org/graphs/raw-file/tip/sql/schema.sql'

    tables = ['os_list',
              'branches',
              'machines',
              'pagesets',
              'tests']

    def __init__(self):
        self.db = sqlite3.connect(':memory:')
        for table in self.tables:
            pass
        schema = urllib2.urlopen(self.schema).read()
        cursor = self.db.cursor()
        cursor.executescript(schema)