diff options
Diffstat (limited to 'db_sqlite.py')
-rw-r--r-- | db_sqlite.py | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/db_sqlite.py b/db_sqlite.py index 189ac57..af7f185 100644 --- a/db_sqlite.py +++ b/db_sqlite.py @@ -11,7 +11,7 @@ def initDB(): """ Check for existing database. If it doesn't exist, build it """ - if not os.path.exists(Globals.db_path): + if not os.path.exists(Globals.db_path) or not os.stat(Globals.db_path).st_size: createTables() loadFromTables() @@ -20,6 +20,7 @@ def createTables(): """ Create database at a specified Globals.db_path """ + print(Globals.db_path) database = QSqlDatabase.addDatabase("QSQLITE") # SQlite version 3 database.setDatabaseName(Globals.db_path) |