Remove function_logger
It doesn't work properly (call methods with an additional "None" argument).
This commit is contained in:
parent
b476db188f
commit
2a484d51d3
@ -69,24 +69,6 @@ def file_is_readable(path: str) -> bool:
|
|||||||
return os.access(path, os.R_OK)
|
return os.access(path, os.R_OK)
|
||||||
|
|
||||||
|
|
||||||
def function_logger(prefix):
|
|
||||||
"""
|
|
||||||
Log function parameters and return
|
|
||||||
|
|
||||||
Source: https://stackoverflow.com/questions/25936746/
|
|
||||||
create-a-function-decorator-that-logs-arguments
|
|
||||||
"""
|
|
||||||
|
|
||||||
def decorate(f):
|
|
||||||
def wrapper(*args, **kwargs):
|
|
||||||
print(prefix, f.__name__, "args", args, "kwargs", kwargs)
|
|
||||||
cr = f(*args, **kwargs)
|
|
||||||
print(prefix, f.__name__, "result", cr)
|
|
||||||
return cr
|
|
||||||
return wrapper
|
|
||||||
return decorate
|
|
||||||
|
|
||||||
|
|
||||||
def get_audio_segment(path: str) -> Optional[AudioSegment]:
|
def get_audio_segment(path: str) -> Optional[AudioSegment]:
|
||||||
try:
|
try:
|
||||||
if path.endswith('.mp3'):
|
if path.endswith('.mp3'):
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user