projects
/
python_utils.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Preformatted box that doesn't wrap the contents.
[python_utils.git]
/
cached
/
weather_forecast.py
diff --git
a/cached/weather_forecast.py
b/cached/weather_forecast.py
index 58f53c383cb2425f1114165cfe3c151978e69cf5..b8a20ed8caa04553f01225a5a2f8f57866858ea7 100644
(file)
--- a/
cached/weather_forecast.py
+++ b/
cached/weather_forecast.py
@@
-1,5
+1,9
@@
#!/usr/bin/env python3
#!/usr/bin/env python3
+# © Copyright 2021-2022, Scott Gasch
+
+"""How's the weather going to be tomorrow?"""
+
import datetime
import logging
import os
import datetime
import logging
import os
@@
-81,7
+85,8
@@
class CachedDetailedWeatherForecast(persistent.Persistent):
last_dt = now
dt = now
for (day, txt) in zip(
last_dt = now
dt = now
for (day, txt) in zip(
- forecast.find_all('b'), forecast.find_all(class_='col-sm-10 forecast-text')
+ forecast.find_all('b'),
+ forecast.find_all(class_='col-sm-10 forecast-text'),
):
last_dt = dt
try:
):
last_dt = dt
try:
@@
-91,9
+96,7
@@
class CachedDetailedWeatherForecast(persistent.Persistent):
assert dt is not None
# Compute sunrise/sunset times on dt.
assert dt is not None
# Compute sunrise/sunset times on dt.
- city = astral.LocationInfo(
- "Bellevue", "USA", "US/Pacific", 47.653, -122.171
- )
+ city = astral.LocationInfo("Bellevue", "USA", "US/Pacific", 47.653, -122.171)
s = sun(city.observer, date=dt, tzinfo=pytz.timezone("US/Pacific"))
sunrise = s['sunrise']
sunset = s['sunset']
s = sun(city.observer, date=dt, tzinfo=pytz.timezone("US/Pacific"))
sunrise = s['sunrise']
sunset = s['sunset']