X-Git-Url: https://wannabe.guru.org/gitweb/?a=blobdiff_plain;f=persistent.py;h=d62dd6754eeffc78c1c09adea7c82e778f8450b3;hb=865825894beeedd47d26dd092d40bfee582f5475;hp=5c2b132448ebce64271c0165a8848337db5e69c8;hpb=36fea7f15ed17150691b5b3ead75450e575229ef;p=python_utils.git diff --git a/persistent.py b/persistent.py index 5c2b132..d62dd67 100644 --- a/persistent.py +++ b/persistent.py @@ -65,11 +65,7 @@ def was_file_written_today(filename: str) -> bool: mtime = file_utils.get_file_mtime_as_datetime(filename) now = datetime.datetime.now() - return ( - mtime.month == now.month - and mtime.day == now.day - and mtime.year == now.year - ) + return mtime.month == now.month and mtime.day == now.day and mtime.year == now.year def was_file_written_within_n_seconds( @@ -144,16 +140,12 @@ class persistent_autoloaded_singleton(object): # Otherwise, try to load it from persisted state. was_loaded = False - logger.debug( - f'Attempting to load {cls.__name__} from persisted state.' - ) + logger.debug(f'Attempting to load {cls.__name__} from persisted state.') self.instance = cls.load() if not self.instance: msg = 'Loading from cache failed.' logger.warning(msg) - logger.debug( - f'Attempting to instantiate {cls.__name__} directly.' - ) + logger.debug(f'Attempting to instantiate {cls.__name__} directly.') self.instance = cls(*args, **kwargs) else: logger.debug(