Skip to content

Commit

Permalink
schema_db uses config_default
Browse files Browse the repository at this point in the history
  • Loading branch information
mblockelet committed Jun 8, 2016
1 parent 47c2071 commit 5742eb9
Showing 1 changed file with 7 additions and 9 deletions.
16 changes: 7 additions & 9 deletions schema_db.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,16 +10,14 @@

import os, sqlite3

def schemaDb():
if os.path.isfile('config.py'):
# DB path already configured
from config import CFG_CACHEDBPATH
dbPath = CFG_CACHEDBPATH
else:
# We use the default DB path
dbPath = 'files/cache/taskgrader-cache.sqlite'
from config_default import CFG_CACHEDBPATH
try:
from config import CFG_CACHEDBPATH
except:
pass

db = sqlite3.connect(dbPath)
def schemaDb():
db = sqlite3.connect(CFG_CACHEDBPATH)
db.execute("""CREATE TABLE IF NOT EXISTS cache
(id INTEGER PRIMARY KEY,
filesid TEXT,
Expand Down

0 comments on commit 5742eb9

Please sign in to comment.