fix: files without suffix are deleted
Signed-off-by: thiswillbeyourgithub <github@32mail.33mail.com>
This commit is contained in:
parent
20027dc16a
commit
d12cd8d452
1 changed files with 2 additions and 2 deletions
|
@ -89,7 +89,7 @@ class AlarmApp:
|
||||||
|
|
||||||
self.num_alarms = 0
|
self.num_alarms = 0
|
||||||
try:
|
try:
|
||||||
with open("alarms", "r") as f:
|
with open("alarms.txt", "r") as f:
|
||||||
alarms = "".join(f.readlines()).split(";")
|
alarms = "".join(f.readlines()).split(";")
|
||||||
for alarm in alarms:
|
for alarm in alarms:
|
||||||
n = self.num_alarms
|
n = self.num_alarms
|
||||||
|
@ -142,7 +142,7 @@ class AlarmApp:
|
||||||
try:
|
try:
|
||||||
if self.num_alarms == 0:
|
if self.num_alarms == 0:
|
||||||
return
|
return
|
||||||
with open("alarms", "w") as f:
|
with open("alarms.txt", "w") as f:
|
||||||
for n in range(self.num_alarms):
|
for n in range(self.num_alarms):
|
||||||
al = self.alarms[n]
|
al = self.alarms[n]
|
||||||
f.write(",".join(map(str, al)) + ";")
|
f.write(",".join(map(str, al)) + ";")
|
||||||
|
|
Loading…
Reference in a new issue