1
0
Fork 0

fix: files without suffix are deleted

Signed-off-by: thiswillbeyourgithub <github@32mail.33mail.com>
This commit is contained in:
thiswillbeyourgithub 2022-07-25 21:42:33 +02:00
parent 20027dc16a
commit d12cd8d452

View file

@ -89,7 +89,7 @@ class AlarmApp:
self.num_alarms = 0
try:
with open("alarms", "r") as f:
with open("alarms.txt", "r") as f:
alarms = "".join(f.readlines()).split(";")
for alarm in alarms:
n = self.num_alarms
@ -142,7 +142,7 @@ class AlarmApp:
try:
if self.num_alarms == 0:
return
with open("alarms", "w") as f:
with open("alarms.txt", "w") as f:
for n in range(self.num_alarms):
al = self.alarms[n]
f.write(",".join(map(str, al)) + ";")