DB config
This commit is contained in:
parent
c91ac2486c
commit
36630b3273
@ -29,7 +29,7 @@ def main():
|
|||||||
if type_names[0] == "IN_MOVED_TO":
|
if type_names[0] == "IN_MOVED_TO":
|
||||||
if filename.endswith(ext):
|
if filename.endswith(ext):
|
||||||
processFIT(filename)
|
processFIT(filename)
|
||||||
deleteFiles(filename)
|
#deleteFiles(filename)
|
||||||
else:
|
else:
|
||||||
os.remove(os.path.join(path, filename))
|
os.remove(os.path.join(path, filename))
|
||||||
|
|
||||||
@ -45,7 +45,7 @@ def processFIT(filename):
|
|||||||
## Verarbeitung starten
|
## Verarbeitung starten
|
||||||
doAll(file)
|
doAll(file)
|
||||||
|
|
||||||
writeDB()
|
writeDB(filename)
|
||||||
|
|
||||||
|
|
||||||
##
|
##
|
||||||
@ -99,7 +99,7 @@ def doHealthFit(file, min_alt=0.0):
|
|||||||
fitData["total_ascent"] = round(float(ges_elev), 1)
|
fitData["total_ascent"] = round(float(ges_elev), 1)
|
||||||
|
|
||||||
|
|
||||||
def writeDB():
|
def writeDB(filename):
|
||||||
global fitData, db_file
|
global fitData, db_file
|
||||||
|
|
||||||
try:
|
try:
|
||||||
@ -121,6 +121,8 @@ def writeDB():
|
|||||||
print("Data inserted successfully into bike_drives table")
|
print("Data inserted successfully into bike_drives table")
|
||||||
cursor.close()
|
cursor.close()
|
||||||
|
|
||||||
|
deleteFiles(filename)
|
||||||
|
|
||||||
except sqlite3.Error as error:
|
except sqlite3.Error as error:
|
||||||
print("Failed to insert data into sqlite table", error)
|
print("Failed to insert data into sqlite table", error)
|
||||||
finally:
|
finally:
|
||||||
|
Loading…
Reference in New Issue
Block a user