annotations, correct plural
This commit is contained in:
parent
c5d10980e9
commit
eb63ba9e99
@ -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)
|
||||
|
||||
Loading…
Reference in New Issue
Block a user