Overrides + debugging modules / functions in logging.
[python_utils.git] / cached / weather_data.py
index d2bf7870c9bbcb98ba164a5f797a47eaf41081b5..45b6e6efc5d9d3c4cbd07f0996633d835aa4a98a 100644 (file)
@@ -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