diff --git a/timeparser.py b/timeparser.py index 2f7e570..fdd26ec 100644 --- a/timeparser.py +++ b/timeparser.py @@ -28,10 +28,13 @@ def read_reminders(): reminders = [line.strip().split(',') for line in file.readlines()] # Remove empty lines reminders = [r for r in reminders if len(r) == 3] - print(reminders,flush=True) if len(reminders) == 0: 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: return [] @@ -60,4 +63,7 @@ if __name__ == '__main__': print(parse_time('1h 2m')) print(parse_time('1h')) print(parse_time('1m 2s')) - print(parse_time('1m')) \ No newline at end of file + print(parse_time('1m')) + print(read_reminders()) + store_reminder(123, datetime.datetime.now(), 'test') + print(read_reminders()) \ No newline at end of file