From 957c962294cde93c4c649ed18dedd16df071878d Mon Sep 17 00:00:00 2001 From: Scott Gasch Date: Sat, 13 Nov 2021 07:06:31 -0800 Subject: Small bugfixes; also, add a new machine to the remote executor pool. --- cached/weather_forecast.py | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'cached') diff --git a/cached/weather_forecast.py b/cached/weather_forecast.py index 7855658..d1e7540 100644 --- a/cached/weather_forecast.py +++ b/cached/weather_forecast.py @@ -4,6 +4,7 @@ from dataclasses import dataclass import datetime import logging import os +from typing import Any import urllib.request import astral # type: ignore @@ -50,7 +51,7 @@ class WeatherForecast: @persistent.persistent_autoloaded_singleton() -class CachedDetailedWeatherForecast(object): +class CachedDetailedWeatherForecast(persistent.Persistent): def __init__(self, forecasts = None): if forecasts is not None: self.forecasts = forecasts @@ -131,7 +132,7 @@ class CachedDetailedWeatherForecast(object): @classmethod @overrides - def load(cls): + def load(cls) -> Any: if persistent.was_file_written_within_n_seconds( config.config['weather_forecast_cachefile'], config.config['weather_forecast_stalest_acceptable'].total_seconds(), @@ -143,7 +144,7 @@ class CachedDetailedWeatherForecast(object): return None @overrides - def save(self): + def save(self) -> bool: import pickle with open(config.config['weather_forecast_cachefile'], 'wb') as wf: pickle.dump( @@ -151,3 +152,4 @@ class CachedDetailedWeatherForecast(object): wf, pickle.HIGHEST_PROTOCOL, ) + return True -- cgit v1.3