From fbc77c47e80f3e3eae6575b743e16d332c76ebbe Mon Sep 17 00:00:00 2001 From: boyska Date: Wed, 25 Aug 2021 00:26:17 +0200 Subject: [PATCH] type annotation in forge --- techrec/forge.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/techrec/forge.py b/techrec/forge.py index c636432..33efd89 100644 --- a/techrec/forge.py +++ b/techrec/forge.py @@ -8,7 +8,7 @@ from time import sleep from .config_manager import get_config -def get_timefile_exact(time): +def get_timefile_exact(time) -> str: """ time is of type `datetime`; it is not "rounded" to match the real file; that work is done in get_timefile(time) @@ -18,14 +18,14 @@ def get_timefile_exact(time): ) -def round_timefile(exact): +def round_timefile(exact:datetime) -> datetime: """ This will round the datetime, so to match the file organization structure """ return datetime(exact.year, exact.month, exact.day, exact.hour) -def get_timefile(exact): +def get_timefile(exact:datetime) -> str: return get_timefile_exact(round_timefile(exact)) @@ -86,7 +86,7 @@ def mp3_join(named_intervals): return cmdline -def create_mp3(start, end, outfile, options={}, **kwargs): +def create_mp3(start: datetime, end: datetime, outfile: str, options={}, **kwargs): intervals = [ (get_timefile(begin), start_cut, end_cut) for begin, start_cut, end_cut in get_files_and_intervals(start, end)