From 6e52afa26d8c50d07988376e43a641c70370b9c5 Mon Sep 17 00:00:00 2001 From: Louie S Date: Sat, 16 Sep 2023 09:36:14 -0400 Subject: Create preferences dialog to control config file --- db_sqlite.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'db_sqlite.py') 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) -- cgit