From 637992eeaad881b79bede6b65575e2ccff12c45a Mon Sep 17 00:00:00 2001 From: Danny Foster Date: Sun, 26 Nov 2023 11:41:03 -0600 Subject: [PATCH 1/9] fix(docs): update incorrect filename --- CONFIGURATION.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/CONFIGURATION.md b/CONFIGURATION.md index d6bdee1..2164ac1 100644 --- a/CONFIGURATION.md +++ b/CONFIGURATION.md @@ -99,7 +99,7 @@ or ### Test Notifications To test your notification configuration, run the following command: ```shell -python tty.py -t +python ttp.py -t ``` ## Retrieval Interval @@ -146,4 +146,4 @@ This indicates the latest appointment you would like to be notified for. To be n [0]: https://github.com/caronc/apprise -[1]: https://github.com/caronc/apprise#supported-notifications \ No newline at end of file +[1]: https://github.com/caronc/apprise#supported-notifications From 5b81361ac0d15f00f4ae1172089b0b715cc42517 Mon Sep 17 00:00:00 2001 From: daytonajrw Date: Thu, 11 Jan 2024 21:59:36 -0500 Subject: [PATCH 2/9] Update notifcation_handler.py Added timestamp to displayed CLI message --- src/notifcation_handler.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/notifcation_handler.py b/src/notifcation_handler.py index a760e97..b83fee8 100644 --- a/src/notifcation_handler.py +++ b/src/notifcation_handler.py @@ -58,9 +58,9 @@ def send_notification(self, body: str, level: int = 1) -> None: # If you encounter Apprise errors, https://github.com/caronc/apprise/wiki/Development_LogCapture # may be useful. if result is None: - print('error: No notifications sent (configuration error)') + print('{datetime.today():%Y/%m/%d %H:%M:%S}: error: No notifications sent (configuration error)') elif result is False: - print('error: At least 1 notification failed to send') + print('{datetime.today():%Y/%m/%d %H:%M:%S}: error: At least 1 notification failed to send') def new_appointment(self, location_id: int, appointments: List[Schedule]) -> None: """ From e7a26dd1bfee91398e3cef51d389415b43c959fb Mon Sep 17 00:00:00 2001 From: daytonajrw Date: Thu, 11 Jan 2024 22:02:06 -0500 Subject: [PATCH 3/9] Update schedule_retriever.py Added timestamp to displayed CLI message --- src/schedule_retriever.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/schedule_retriever.py b/src/schedule_retriever.py index 984f997..d26815f 100644 --- a/src/schedule_retriever.py +++ b/src/schedule_retriever.py @@ -131,7 +131,7 @@ def _clear_database_of_claimed_appointments( ) if cursor.rowcount > 0: - print(f"Removed {cursor.rowcount} appointments that have been claimed for location {location_id}.\n") + print(f"{datetime.today():%Y/%m/%d %H:%M:%S}: Removed {cursor.rowcount} appointments that have been claimed for location {location_id}.\n") conn.commit() conn.close() @@ -152,7 +152,7 @@ def _get_schedule(self, location_id: int) -> None: ).json() if not appointments: - print(f"No active appointments available for location {location_id}.") + print(f"{datetime.today():%Y/%m/%d %H:%M:%S}: No active appointments available for location {location_id}.") return schedule = [] From c436654e596f021d1316fa848de0711c60a091e2 Mon Sep 17 00:00:00 2001 From: daytonajrw Date: Thu, 11 Jan 2024 22:32:26 -0500 Subject: [PATCH 4/9] Update notifcation_handler.py Add CLI timestamp for new appointment times --- src/notifcation_handler.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/notifcation_handler.py b/src/notifcation_handler.py index b83fee8..c7f30f8 100644 --- a/src/notifcation_handler.py +++ b/src/notifcation_handler.py @@ -43,7 +43,7 @@ def send_notification(self, body: str, level: int = 1) -> None: level (int, optional): The level of the notification. If the level is less than the configured notification level, the notification will not be sent. Defaults to 1. """ - print(body) + print(f"{datetime.today():%Y/%m/%d %H:%M:%S}: {body}\n") # Check the level to see if we still want to send it. If level is none, it means # the message will always be printed. For example, this is used when testing notifications. From 9437132a54ee32a4cae7a3e3bc271df3bd341c7d Mon Sep 17 00:00:00 2001 From: daytonajrw Date: Fri, 12 Jan 2024 17:56:03 -0500 Subject: [PATCH 5/9] Update notifcation_handler.py Added CLI timestamps to messages --- src/notifcation_handler.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/notifcation_handler.py b/src/notifcation_handler.py index a760e97..c7f30f8 100644 --- a/src/notifcation_handler.py +++ b/src/notifcation_handler.py @@ -43,7 +43,7 @@ def send_notification(self, body: str, level: int = 1) -> None: level (int, optional): The level of the notification. If the level is less than the configured notification level, the notification will not be sent. Defaults to 1. """ - print(body) + print(f"{datetime.today():%Y/%m/%d %H:%M:%S}: {body}\n") # Check the level to see if we still want to send it. If level is none, it means # the message will always be printed. For example, this is used when testing notifications. @@ -58,9 +58,9 @@ def send_notification(self, body: str, level: int = 1) -> None: # If you encounter Apprise errors, https://github.com/caronc/apprise/wiki/Development_LogCapture # may be useful. if result is None: - print('error: No notifications sent (configuration error)') + print('{datetime.today():%Y/%m/%d %H:%M:%S}: error: No notifications sent (configuration error)') elif result is False: - print('error: At least 1 notification failed to send') + print('{datetime.today():%Y/%m/%d %H:%M:%S}: error: At least 1 notification failed to send') def new_appointment(self, location_id: int, appointments: List[Schedule]) -> None: """ From 419918558ab0d42f4738afb53a95df74dbaa9c77 Mon Sep 17 00:00:00 2001 From: daytonajrw Date: Fri, 12 Jan 2024 17:57:01 -0500 Subject: [PATCH 6/9] Update schedule_retriever.py Added CLI timestamps to messages --- src/schedule_retriever.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/schedule_retriever.py b/src/schedule_retriever.py index 984f997..d26815f 100644 --- a/src/schedule_retriever.py +++ b/src/schedule_retriever.py @@ -131,7 +131,7 @@ def _clear_database_of_claimed_appointments( ) if cursor.rowcount > 0: - print(f"Removed {cursor.rowcount} appointments that have been claimed for location {location_id}.\n") + print(f"{datetime.today():%Y/%m/%d %H:%M:%S}: Removed {cursor.rowcount} appointments that have been claimed for location {location_id}.\n") conn.commit() conn.close() @@ -152,7 +152,7 @@ def _get_schedule(self, location_id: int) -> None: ).json() if not appointments: - print(f"No active appointments available for location {location_id}.") + print(f"{datetime.today():%Y/%m/%d %H:%M:%S}: No active appointments available for location {location_id}.") return schedule = [] From 95442b6dba996ec470648a07be6ddd1a5e8c019d Mon Sep 17 00:00:00 2001 From: daytonajrw Date: Mon, 22 Jan 2024 21:22:33 -0500 Subject: [PATCH 7/9] Update requirements.txt --- requirements.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/requirements.txt b/requirements.txt index d4ea8ef..c7e72af 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,2 +1,2 @@ -apprise==1.6.0 +apprise==1.7.1 requests==2.31.0 From 8159924033fea6d5f70738c4bd35ef7fc0152ec2 Mon Sep 17 00:00:00 2001 From: daytonajrw Date: Mon, 22 Jan 2024 21:25:36 -0500 Subject: [PATCH 8/9] Update CONFIGURATION.md --- CONFIGURATION.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CONFIGURATION.md b/CONFIGURATION.md index 2164ac1..a9f8c3a 100644 --- a/CONFIGURATION.md +++ b/CONFIGURATION.md @@ -36,7 +36,7 @@ This above configuration will notify you if a new appointment is found for Decem Default: [] -Type: List or Integer +Type: Comma Seperated List or Integer This represents the IDs of the enrollment centers you wish to monitor. This can either be a list of locations, or a singular location represented by an integer. This list is used in addition to whatever arguments you pass in at run-time of the script. For more information on locations, please see [LOCATIONS.md](LOCATIONS.md). From c7fde5b442a284692c5ce8e8e7403d8be11810ab Mon Sep 17 00:00:00 2001 From: daytonajrw Date: Mon, 22 Jan 2024 21:26:44 -0500 Subject: [PATCH 9/9] Update CONFIGURATION.md --- CONFIGURATION.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CONFIGURATION.md b/CONFIGURATION.md index a9f8c3a..749d6e4 100644 --- a/CONFIGURATION.md +++ b/CONFIGURATION.md @@ -42,7 +42,7 @@ This represents the IDs of the enrollment centers you wish to monitor. This can ```json { - "location_ids": [ 5140 ] + "location_ids": [ 5140,5444 ] } ```