run yapf on gendb.py
parent
1031404280
commit
00d07f7ab7
|
@ -96,7 +96,8 @@ CREATE TABLE sourceentry_background (
|
||||||
srcentrydata.append((abbr, page_start, page_stop))
|
srcentrydata.append((abbr, page_start, page_stop))
|
||||||
stmt = "INSERT INTO background(name, descr, is_comty_use, is_specific_to_adv) VALUES (?,?,?,?)"
|
stmt = "INSERT INTO background(name, descr, is_comty_use, is_specific_to_adv) VALUES (?,?,?,?)"
|
||||||
try:
|
try:
|
||||||
conn.execute(stmt, (i['name'], i['descr'], i['is_comty_use'], i['is_specific_to_adv']))
|
conn.execute(stmt, (i['name'], i['descr'], i['is_comty_use'],
|
||||||
|
i['is_specific_to_adv']))
|
||||||
except:
|
except:
|
||||||
print("Error creating background")
|
print("Error creating background")
|
||||||
else:
|
else:
|
||||||
|
@ -107,6 +108,7 @@ CREATE TABLE sourceentry_background (
|
||||||
# TODO
|
# TODO
|
||||||
link_sourceentry_backgrounds(i['name'], srcentrydata, conn)
|
link_sourceentry_backgrounds(i['name'], srcentrydata, conn)
|
||||||
|
|
||||||
|
|
||||||
def link_sourceentry_backgrounds(name, srcentrydata, conn):
|
def link_sourceentry_backgrounds(name, srcentrydata, conn):
|
||||||
stmt = """
|
stmt = """
|
||||||
INSERT INTO sourceentry_background (sourceentry_id, background_id)
|
INSERT INTO sourceentry_background (sourceentry_id, background_id)
|
||||||
|
@ -129,6 +131,7 @@ INSERT INTO sourceentry_background (sourceentry_id, background_id)
|
||||||
else:
|
else:
|
||||||
conn.commit()
|
conn.commit()
|
||||||
|
|
||||||
|
|
||||||
def do_conditions(data, conn):
|
def do_conditions(data, conn):
|
||||||
# MAKE THE 2 TABLES
|
# MAKE THE 2 TABLES
|
||||||
table = """
|
table = """
|
||||||
|
|
Loading…
Reference in New Issue