From 0f2763acd2fa4247e9957faba6344486ba82613a Mon Sep 17 00:00:00 2001 From: ManuelW Date: Sat, 11 May 2024 11:06:19 +0200 Subject: [PATCH] DB config --- parseFitFiles.py | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/parseFitFiles.py b/parseFitFiles.py index 4c7b7b0..42353c8 100644 --- a/parseFitFiles.py +++ b/parseFitFiles.py @@ -30,6 +30,8 @@ def main(): if filename.endswith(ext): processFIT(filename) deleteFiles(filename) + else: + os.remove(os.path.join(path, filename)) pass @@ -129,11 +131,7 @@ def writeDB(): def deleteFiles(filename): try: - for fname in os.listdir(path): - print("sehe file:", fname) - if fname.startswith(filename[:-4]): - os.remove(os.path.join(path, fname)) - print("lösche", fname) + os.remove(os.path.join(path, filename)) except Exception as e: print('Failed to delete %s. Reason: %s' % (path+filename, e))