fix: typo in reminders count
All checks were successful
Build Docker / Build Docker (push) Successful in 17s
All checks were successful
Build Docker / Build Docker (push) Successful in 17s
This commit is contained in:
parent
9db6c0e8b3
commit
65d7252f5f
@ -28,10 +28,13 @@ def read_reminders():
|
|||||||
reminders = [line.strip().split(',') for line in file.readlines()]
|
reminders = [line.strip().split(',') for line in file.readlines()]
|
||||||
# Remove empty lines
|
# Remove empty lines
|
||||||
reminders = [r for r in reminders if len(r) == 3]
|
reminders = [r for r in reminders if len(r) == 3]
|
||||||
print(reminders,flush=True)
|
|
||||||
if len(reminders) == 0:
|
if len(reminders) == 0:
|
||||||
return []
|
return []
|
||||||
return [{'user_id': r[0], 'time': r[2], 'text': r[3]} for r in reminders]
|
return [{
|
||||||
|
'user_id': r[0],
|
||||||
|
'time': r[1],
|
||||||
|
'text': r[2]
|
||||||
|
} for r in reminders]
|
||||||
except FileNotFoundError:
|
except FileNotFoundError:
|
||||||
return []
|
return []
|
||||||
|
|
||||||
@ -60,4 +63,7 @@ if __name__ == '__main__':
|
|||||||
print(parse_time('1h 2m'))
|
print(parse_time('1h 2m'))
|
||||||
print(parse_time('1h'))
|
print(parse_time('1h'))
|
||||||
print(parse_time('1m 2s'))
|
print(parse_time('1m 2s'))
|
||||||
print(parse_time('1m'))
|
print(parse_time('1m'))
|
||||||
|
print(read_reminders())
|
||||||
|
store_reminder(123, datetime.datetime.now(), 'test')
|
||||||
|
print(read_reminders())
|
Loading…
Reference in New Issue
Block a user