summaryrefslogtreecommitdiff
path: root/cached/weather_data.py
diff options
context:
space:
mode:
authorScott Gasch <[email protected]>2021-11-01 14:10:02 -0700
committerScott Gasch <[email protected]>2021-11-01 14:10:02 -0700
commitacacd9d2e942d084631e99e94ee430fd26ae9893 (patch)
tree56bedbc8b3237a6f10264f3b448a176bcdcb89ab /cached/weather_data.py
parenteb9e6df32ed696158bf34dba6464277b648f5c74 (diff)
Overrides + debugging modules / functions in logging.
Diffstat (limited to 'cached/weather_data.py')
-rw-r--r--cached/weather_data.py11
1 files changed, 8 insertions, 3 deletions
diff --git a/cached/weather_data.py b/cached/weather_data.py
index d2bf787..45b6e6e 100644
--- a/cached/weather_data.py
+++ b/cached/weather_data.py
@@ -5,9 +5,11 @@ import datetime
import json
import logging
import os
-from typing import List
+from typing import Any, List
import urllib.request
+from overrides import overrides
+
import argparse_utils
import config
import datetime_utils
@@ -179,7 +181,8 @@ class CachedWeatherData(persistent.Persistent):
)
@classmethod
- def load(cls):
+ @overrides
+ def load(cls) -> Any:
if persistent.was_file_written_within_n_seconds(
config.config['weather_data_cachefile'],
config.config['weather_data_stalest_acceptable'].total_seconds(),
@@ -190,7 +193,8 @@ class CachedWeatherData(persistent.Persistent):
return cls(weather_data)
return None
- def save(self):
+ @overrides
+ def save(self) -> bool:
import pickle
with open(config.config['weather_data_cachefile'], 'wb') as wf:
pickle.dump(
@@ -198,3 +202,4 @@ class CachedWeatherData(persistent.Persistent):
wf,
pickle.HIGHEST_PROTOCOL,
)
+ return True