From 36630b32732ce5d1e3f8fab1cf39daf69f750426 Mon Sep 17 00:00:00 2001 From: ManuelW Date: Sat, 11 May 2024 12:06:17 +0200 Subject: [PATCH] DB config --- parseFitFiles.py | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/parseFitFiles.py b/parseFitFiles.py index 42353c8..6936ac1 100644 --- a/parseFitFiles.py +++ b/parseFitFiles.py @@ -29,7 +29,7 @@ def main(): if type_names[0] == "IN_MOVED_TO": if filename.endswith(ext): processFIT(filename) - deleteFiles(filename) + #deleteFiles(filename) else: os.remove(os.path.join(path, filename)) @@ -45,7 +45,7 @@ def processFIT(filename): ## Verarbeitung starten doAll(file) - writeDB() + writeDB(filename) ## @@ -99,7 +99,7 @@ def doHealthFit(file, min_alt=0.0): fitData["total_ascent"] = round(float(ges_elev), 1) -def writeDB(): +def writeDB(filename): global fitData, db_file try: @@ -121,6 +121,8 @@ def writeDB(): print("Data inserted successfully into bike_drives table") cursor.close() + deleteFiles(filename) + except sqlite3.Error as error: print("Failed to insert data into sqlite table", error) finally: