summaryrefslogtreecommitdiff
path: root/persistent.py
diff options
context:
space:
mode:
Diffstat (limited to 'persistent.py')
-rw-r--r--persistent.py14
1 files changed, 3 insertions, 11 deletions
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(