I've been doing this all wrong for a long time

This commit is contained in:
Luke Rogers 2014-02-14 19:43:36 +13:00
parent 27b62feb5f
commit b6558ccdd5
7 changed files with 43 additions and 31 deletions

View file

@ -11,10 +11,12 @@ db_ready = False
def db_init(db):
"""check to see that our db has the the seen table and return a connection."""
db.execute("create table if not exists seen_user(name, time, quote, chan, host, "
"primary key(name, chan))")
db.commit()
db_ready = True
global db_ready
if not db_ready:
db.execute("create table if not exists seen_user(name, time, quote, chan, host, "
"primary key(name, chan))")
db.commit()
db_ready = True
@hook.singlethread