Compare commits
No commits in common. "d99f514dfc60f0e494baaf3f29f2cdabd981f203" and "0ecc4577c21422032a469af3dde216b4c4d65f2e" have entirely different histories.
d99f514dfc
...
0ecc4577c2
1 changed files with 11 additions and 16 deletions
17
scl.py
17
scl.py
|
@ -246,22 +246,17 @@ def do_initial_post(
|
|||
map_media_post = None
|
||||
hashtag_string = get_hashtag_string(event)
|
||||
|
||||
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)
|
||||
)
|
||||
|
||||
post_text = """Seattle City Light is reporting a {} outage in {}.
|
||||
|
||||
Start Date: {}{}
|
||||
Start Date: {}
|
||||
Est. Restoration: {}
|
||||
Cause: {}
|
||||
|
||||
{}""".format(
|
||||
event_class["size"].lower(),
|
||||
area_text,
|
||||
start_time.strftime(post_datetime_format),
|
||||
est_restoration_post_text,
|
||||
estimated_restoration_time.strftime(post_datetime_format),
|
||||
event["cause"],
|
||||
hashtag_string,
|
||||
)
|
||||
|
@ -338,8 +333,6 @@ with Session(engine) as session:
|
|||
updated_entries = []
|
||||
if estimated_restoration_time != existing_record.estimated_restoration_time:
|
||||
existing_record.estimated_restoration_time = estimated_restoration_time
|
||||
if estimated_restoration_time > datetime.now():
|
||||
# New estimated restoration time is in the future, so likely to be a real time
|
||||
updated_properties.append("estimated restoration")
|
||||
updated_entries.append(
|
||||
"Est. Restoration: {}".format(
|
||||
|
@ -460,7 +453,9 @@ with Session(engine) as session:
|
|||
if active_outage.most_recent_post_id:
|
||||
try:
|
||||
post_result = mastodon_client.status_post(
|
||||
status="This outage is reported to be resolved.\n\n#SeattleCityLightOutage #SCLOutage",
|
||||
status="This outage is reported to be resolved.\n\n#SeattleCityLightOutage #SCLOutage #SCLOutage{}".format(
|
||||
active_outage.outage_user_id
|
||||
),
|
||||
in_reply_to_id=active_outage.most_recent_post_id,
|
||||
visibility="public",
|
||||
language="en",
|
||||
|
|
Loading…
Reference in a new issue