diff options
-rw-r--r-- | src/argaze/utils/UtilsFeatures.py | 38 |
1 files changed, 19 insertions, 19 deletions
diff --git a/src/argaze/utils/UtilsFeatures.py b/src/argaze/utils/UtilsFeatures.py index d9d6c41..f24c562 100644 --- a/src/argaze/utils/UtilsFeatures.py +++ b/src/argaze/utils/UtilsFeatures.py @@ -167,6 +167,24 @@ def tuple_to_string(t: tuple, separator: str = ", ") -> str: return separator.join(f'\"{e}\"' for e in t) +def PrintCallStack(method): + """Define a decorator to print call stack until the decorated method.""" + + def wrapper(self, *args, **kwargs): + """Wrap method to print call stack before its call. + + Parameters: + args: method arguments. + kwargs: extra arguments. + """ + print(f'Call stack until method \'{method.__name__}\':', ) + + traceback.print_stack() + + return method(self, *args, **kwargs) + + return wrapper + class FileWriter(DataFeatures.PipelineStepObject): """Write data into a file line by line.""" @@ -361,24 +379,6 @@ class VideoWriter(DataFeatures.PipelineStepObject, DataFeatures.SharedObject): if self.__process.poll() is None: # Resize image to adapt to video resolution - output = cv2.resize(image, dsize=(self.__width, self.__height), interpolation=cv2.INTER_LINEAR) + output = cv2.resize(image, dsize=(self.__width, self.__height), interpolation=cv2.INTER_LINEAR) self.__process.stdin.write(output.tobytes()) - -def PrintCallStack(method): - """Define a decorator to print call stack until the decorated method.""" - - def wrapper(self, *args, **kwargs): - """Wrap method to print call stack before its call. - - Parameters: - args: method arguments. - kwargs: extra arguments. - """ - print(f'Call stack until method \'{method.__name__}\':', ) - - traceback.print_stack() - - return method(self, *args, **kwargs) - - return wrapper
\ No newline at end of file |