Applied auto pep 8 changes

This commit is contained in:
2024-01-21 22:06:06 +00:00
parent f227727c74
commit 44c1ee03ba
22 changed files with 156 additions and 100 deletions

View File

@ -14,14 +14,14 @@ def create_connection(path: str, filename: str):
print("Database file open")
# Execute creation scripts
sql = open("scripts/create_tables.sql", "r");
sql = open("scripts/create_tables.sql", "r")
conn.executescript(sql.read())
print("Table creation complete")
# Populate with test data if we are in Test Mode
if os.environ.get("ENVIRON") == "test":
sql = open("scripts/test_data.sql", "r");
sql = open("scripts/test_data.sql", "r")
conn.executescript(sql.read())
except sqlite3.Error as e:
@ -31,12 +31,15 @@ def create_connection(path: str, filename: str):
conn.close()
# Ensure a directory is created given a path to it
def create_directory(dir: str):
try:
os.makedirs(dir)
except FileExistsError:
pass
def remove_file(dir: str):
try:
os.remove(dir)
@ -44,7 +47,6 @@ def remove_file(dir: str):
pass
dir = r"./data/"
db_name = r"wmgzon.db"