annotations, correct plural

This commit is contained in:
Stefan Harmuth 2021-12-07 06:54:31 +01:00
parent c5d10980e9
commit eb63ba9e99

View File

@ -5,7 +5,7 @@ import sys
from typing import Any 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""" """return path of the executed script"""
if getattr(sys, 'frozen', False): if getattr(sys, 'frozen', False):
path = os.path.abspath(sys.executable) 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: def human_readable_time_from_delta(delta: datetime.timedelta) -> str:
time_str = "" time_str = ""
if delta.days > 0: 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: if delta.seconds > 3600:
time_str += "%02d:" % (delta.seconds // 3600) time_str += "%02d:" % (delta.seconds // 3600)