diff options
Diffstat (limited to 'sources/shiboken2/shibokenmodule/files.dir/shibokensupport/signature/lib/tool.py')
-rw-r--r-- | sources/shiboken2/shibokenmodule/files.dir/shibokensupport/signature/lib/tool.py | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/sources/shiboken2/shibokenmodule/files.dir/shibokensupport/signature/lib/tool.py b/sources/shiboken2/shibokenmodule/files.dir/shibokensupport/signature/lib/tool.py index 24e75e42c..c8dbd51cc 100644 --- a/sources/shiboken2/shibokenmodule/files.dir/shibokensupport/signature/lib/tool.py +++ b/sources/shiboken2/shibokenmodule/files.dir/shibokensupport/signature/lib/tool.py @@ -47,6 +47,7 @@ On the function with_metaclass see the answer from Martijn Pieters on https://stackoverflow.com/questions/18513821/python-metaclass-understanding-the-with-metaclass """ +from inspect import currentframe from textwrap import dedent @@ -151,4 +152,11 @@ def with_metaclass(meta, *bases): return meta.__prepare__(name, bases) return type.__new__(metaclass, 'temporary_class', (), {}) + +# A handy tool that shows the current line number and indents. +def lno(level): + lineno = currentframe().f_back.f_lineno + spaces = level * " " + return "{}{}".format(lineno, spaces) + # eof |