summaryrefslogtreecommitdiffstats
path: root/util/cmake/helper.py
diff options
context:
space:
mode:
Diffstat (limited to 'util/cmake/helper.py')
-rw-r--r--util/cmake/helper.py26
1 files changed, 26 insertions, 0 deletions
diff --git a/util/cmake/helper.py b/util/cmake/helper.py
index 682e2ec15f..b7d91921fa 100644
--- a/util/cmake/helper.py
+++ b/util/cmake/helper.py
@@ -428,3 +428,29 @@ def generate_find_package_info(lib: LibraryMapping,
ind=one_ind)
return result
+
+
+def _set_up_py_parsing_nicer_debug_output(pp):
+ indent = -1
+
+ def increase_indent(fn):
+ def wrapper_function(*args):
+ nonlocal indent
+ indent += 1
+ print("> " * indent, end="")
+ return fn(*args)
+
+ return wrapper_function
+
+ def decrease_indent(fn):
+ def wrapper_function(*args):
+ nonlocal indent
+ print("> " * indent, end="")
+ indent -= 1
+ return fn(*args)
+
+ return wrapper_function
+
+ pp._defaultStartDebugAction = increase_indent(pp._defaultStartDebugAction)
+ pp._defaultSuccessDebugAction = decrease_indent(pp._defaultSuccessDebugAction)
+ pp._defaultExceptionDebugAction = decrease_indent(pp._defaultExceptionDebugAction)