aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/argaze/utils/UtilsFeatures.py21
1 files changed, 20 insertions, 1 deletions
diff --git a/src/argaze/utils/UtilsFeatures.py b/src/argaze/utils/UtilsFeatures.py
index da7565b..0a22aaf 100644
--- a/src/argaze/utils/UtilsFeatures.py
+++ b/src/argaze/utils/UtilsFeatures.py
@@ -10,6 +10,7 @@ __license__ = "BSD"
from typing import Tuple
import time
import types
+import traceback
import numpy
import cv2
@@ -261,4 +262,22 @@ class VideoWriter():
# Terminate the sub-process
# Note: We don't have to terminate the sub-process (after process.wait(), the sub-process is supposed to be closed).
- self.__process.terminate() \ No newline at end of file
+ self.__process.terminate()
+
+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