From 635097da91872274abb218035443d3fb1c8c8513 Mon Sep 17 00:00:00 2001 From: Liam Steckler Date: Wed, 9 Jul 2025 18:56:51 -0700 Subject: [PATCH] Change POST_DATETIME_FORMAT to const --- scl.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/scl.py b/scl.py index e964b2e..0b2fa5f 100644 --- a/scl.py +++ b/scl.py @@ -18,7 +18,7 @@ from sqlalchemy.orm import DeclarativeBase, Mapped, Session, mapped_column from geospatial import DBGeometry, convert_outage_geometry REQUESTS_HEADERS = {"User-Agent": "seattlecitylight-mastodon-bot"} -post_datetime_format = "%b %e %l:%M %p" +POST_DATETIME_FORMAT = "%b %e %l:%M %p" scl_events_url = "https://utilisocial.io/datacapable/v2/p/scl/map/events" scl_events_response = requests.get(scl_events_url) @@ -271,7 +271,7 @@ def do_initial_post( est_restoration_post_text = str() if estimated_restoration_time > datetime.now(): est_restoration_post_text = "\nEst. Restoration: {}\n".format( - estimated_restoration_time.strftime(post_datetime_format) + estimated_restoration_time.strftime(POST_DATETIME_FORMAT) ) post_text = """Seattle City Light is reporting a {} outage in {}. @@ -282,7 +282,7 @@ Cause: {} {}""".format( event_class["size"].lower(), area_text, - start_time.strftime(post_datetime_format), + start_time.strftime(POST_DATETIME_FORMAT), est_restoration_post_text, event["cause"], hashtag_string, @@ -382,7 +382,7 @@ with Session(engine) as session: updated_properties.append("estimated restoration") updated_entries.append( "Est. Restoration: {}".format( - estimated_restoration_time.strftime(post_datetime_format) + estimated_restoration_time.strftime(POST_DATETIME_FORMAT) ) ) if event["cause"] != existing_record.cause: