Simplify dbHelper

This commit is contained in:
Klaus-Uwe Mitterer 2015-04-22 00:21:16 +02:00
parent 3feb8c0455
commit a1d0c7fd97

View file

@ -31,19 +31,19 @@ class dbObject:
return False
def dbCheck(path):
if dbInitialized(path):
def dbCheck(db):
if dbInitialized(db):
return True
raise ValueError("Provided database file " + path + " is not initialized. Create it using makedb.py or csvdb.py")
def dbHelper(path):
dbCheck(path)
return dbObject(path)
def dbInitialized(path):
db = dbObject(path)
dbCheck(db)
return db
def dbInitialized(db):
return db.isInitialized()