mewlo.mpacks.core.helpers.debugging module

debugging.py This module contains miscelaneous functions that aid debugging and logging and error reporting.

mewlo.mpacks.core.helpers.debugging.calc_caller_dict(depth=0)[source]

Helper function that returns info about the caller; useful for displaying what linenumber something happened in, etc. Depth of 0 will give us the CALLERS info. Depth of 1 will be caller’s caller.

mewlo.mpacks.core.helpers.debugging.calc_caller_tuple(depth=0)[source]

Helper function that returns info about the caller; useful for displaying what linenumber something happened in, etc. Depth of 0 will give us the CALLERS info. Depth of 1 will be caller’s caller.

mewlo.mpacks.core.helpers.debugging.compute_traceback_astext(traceback_object=None, flag_fulltrace=True)[source]

Convert traceback object to nice text. See http://effbot.org/librarybook/traceback.htm.

mewlo.mpacks.core.helpers.debugging.compute_traceback_astext_fromlist(tblist)[source]

Internal helper funciton. Convert traceback extract list into string.

mewlo.mpacks.core.helpers.debugging.smart_dotted_idpath(obj)[source]

We try to get a nice dotted path for an object, by assuming it has attribute accessor functions of get_parent and get_id We walk up parent path (as far as we are able) and return a dotted path string. This function depends on the convention of the object methods get_parent and get_id. When there is no get_parent we stop traveling up chaing. When there is no get_id we simply use class name. You can see this function in use in some cases where we catch an exception and want to add some additional info about an object related to the exception.

mewlo.mpacks.core.helpers.debugging.smart_dotted_idpath_getobjidstr(obj)[source]

Interal use function. Return the nice idstr for the object; fall back on classname if needed.

mewlo.mpacks.core.helpers.debugging.smart_dotted_idpath_getparentobj(obj)[source]

Interal use function. Return the parent object of this object, IFF we can find a get_parent function to call; otherwise return None

Table Of Contents

Previous topic

mewlo.mpacks.core.helpers.cfgmodule module

Next topic

mewlo.mpacks.core.helpers.dictlist module

This Page