예제 #1
0
def _setup_db(cursor):
    cmd = cursor
    t = NameTable('themes', ['theme'])
    cmd.execute('create table %s' %t)
    cmd.execute(insert('themes', {'theme':'themebase'}))
    t = ThemeTable('themebase')
    cmd.execute('create table %s' %t)
    cols = [x.name for x in t.columns]
    #print cmd.tables()

    q1 = insert('themebase',
                dict(zip(cols, ['fg', 'black', 'seashell', 'black', 'sky blue', 'plum'])))
    q2 = insert('themebase',
                dict(zip(cols, ['bg', 'cyan3', 'seashell',
                                'cyan4', 'light coral', 'grey'])))
    q3 = insert('themebase',
                dict(zip(cols, ['base', 'light sea green',
                                'lavender', 'azure3', 'yellow', 'aquamarine'])))
    q4 = insert('themebase',
                dict(zip(cols, ['text', 'wheat', 'black',
                                'black', 'black', 'dark violet'])))
    map(cmd.execute, [q1, q2, q3, q4])
예제 #2
0
def fill_table(cursor, table, rows):
    columns = [x.name for x in table.columns]
    for row in rows:
        idict = dict(zip(columns, row[1:]))
        cursor.execute(insert(table.name, idict))
예제 #3
0
def fill_table(cursor, table, rows):
    columns = [x.name for x in table.columns]
    for row in rows:
        idict = dict(zip(columns, row[1:]))
        cursor.execute(insert(table.name, idict))
예제 #4
0
 def insert(self, table, adict):
     query = insert(table, adict)
     #print query
     self.execute(query)
예제 #5
0
 def insert(self, table, adict):
     query = insert(table, adict)
     #print query
     self.execute(query)