diff --git a/tools/tools.py b/tools/tools.py index c277cc6..69e9b0e 100644 --- a/tools/tools.py +++ b/tools/tools.py @@ -5,7 +5,7 @@ import sys from typing import Any -def get_script_dir(follow_symlinks=True): +def get_script_dir(follow_symlinks: bool = True) -> str: """return path of the executed script""" if getattr(sys, 'frozen', False): path = os.path.abspath(sys.executable) @@ -29,7 +29,7 @@ def compare(a: Any, b: Any) -> int: def human_readable_time_from_delta(delta: datetime.timedelta) -> str: time_str = "" if delta.days > 0: - time_str += "%d days, " % delta.days + time_str += "%d day%s, " % (delta.days, "s" if delta.days > 1 else "") if delta.seconds > 3600: time_str += "%02d:" % (delta.seconds // 3600)