diff --git a/rhodecode/lib/utils2.py b/rhodecode/lib/utils2.py --- a/rhodecode/lib/utils2.py +++ b/rhodecode/lib/utils2.py @@ -319,6 +319,21 @@ def find_calling_context(ignore_modules= this function and is part of core module ( ie. rhodecode.* ) :param ignore_modules: list of modules to ignore eg. ['rhodecode.lib'] + + usage:: + from rhodecode.lib.utils2 import find_calling_context + + calling_context = find_calling_context(ignore_modules=[ + 'rhodecode.lib.caching_query', + 'rhodecode.model.settings', + ]) + + if calling_context: + cc_str = 'call context %s:%s' % ( + calling_context.f_code.co_filename, + calling_context.f_lineno, + ) + print(cc_str) """ ignore_modules = ignore_modules or []