summaryrefslogtreecommitdiff
path: root/persistent.py
diff options
context:
space:
mode:
authorScott <[email protected]>2022-02-02 09:14:12 -0800
committerScott <[email protected]>2022-02-02 09:14:12 -0800
commita4bf4d05230474ad14243d67ac7f8c938f670e58 (patch)
tree673fb8bea628ce51b942d93ba5df433732c7384e /persistent.py
parent971d4ba141459f78d10d5770b9459d1ead7d49a0 (diff)
More type annotations.
Diffstat (limited to 'persistent.py')
-rw-r--r--persistent.py3
1 files changed, 2 insertions, 1 deletions
diff --git a/persistent.py b/persistent.py
index d62dd67..7136559 100644
--- a/persistent.py
+++ b/persistent.py
@@ -64,6 +64,7 @@ def was_file_written_today(filename: str) -> bool:
return False
mtime = file_utils.get_file_mtime_as_datetime(filename)
+ assert mtime
now = datetime.datetime.now()
return mtime.month == now.month and mtime.day == now.day and mtime.year == now.year
@@ -80,6 +81,7 @@ def was_file_written_within_n_seconds(
return False
mtime = file_utils.get_file_mtime_as_datetime(filename)
+ assert mtime
now = datetime.datetime.now()
return (now - mtime).total_seconds() <= limit_seconds
@@ -126,7 +128,6 @@ class persistent_autoloaded_singleton(object):
self.instance = None
def __call__(self, cls: Persistent):
- @functools.wraps(cls)
def _load(*args, **kwargs):
# If class has already been loaded, act like a singleton