#4 #6 Completed functionlity to update products in place. Form still needs tidying up

This commit is contained in:
2024-01-25 00:05:34 +00:00
parent 0951bcc23e
commit 0358670071
5 changed files with 55 additions and 33 deletions

View File

@ -1,5 +1,11 @@
import sqlite3
import os
import sys
if __name__ == "__main__":
sys.path.append(os.getcwd())
from utils.file_utils import create_directory, remove_file
def create_connection(path: str, filename: str):
@ -30,23 +36,8 @@ def create_connection(path: str, filename: str):
if conn:
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)
except FileNotFoundError:
pass
dir = r"./data/"
db_name = r"wmgzon.db"