4.18. foundations.trace

trace.py

Platform:
Windows, Linux, Mac Os X.
Description:
This module defines Foundations package trace objects.
Others:
Portions of the code from echo.py by Thomas Guest: http://wordaligned.org/svn/etc/echo/echo.py.

4.18.1. Module Attributes

foundations.trace.REGISTERED_MODULES
foundations.trace.TRACER_SYMBOL
foundations.trace.UNTRACABLE_SYMBOL
foundations.trace.TRACER_HOOK
foundations.trace.UNTRACABLE_NAMES
foundations.trace.NULL_OBJECT_NAME
foundations.trace.TRACE_NAMES_CACHE
foundations.trace.TRACE_WALKER_CACHE

4.18.2. Functions

foundations.trace.isReadOnly(object)[source]

This definition returns if given object is read only ( built-in or extension ).

Parameters:object – Object. ( Object )
Returns:Is object read only. ( Boolean )
foundations.trace.setTracerHook(object, hook)[source]

This definition sets given object tracer hook on given object.

Parameters:
  • hook – Tracer hook. ( Object )
  • object – Object. ( Object )
Returns:

Definition success. ( Boolean )

foundations.trace.getTracerHook(object)[source]

This definition returns given object tracer hook.

Parameters:object – Object. ( Object )
Returns:Object tracer hook. ( Object )
foundations.trace.isTraced(object)[source]

This definition returns if given object is traced.

Parameters:object – Object. ( Object )
Returns:Is object traced. ( Boolean )
foundations.trace.isBaseTraced(cls)[source]

This definition returns if given class has a traced base.

Parameters:cls – Class. ( Object )
Returns:Is base traced. ( Boolean )
foundations.trace.isUntracable(object)[source]

This definition returns if given object is untracable.

Parameters:object – Object. ( Object )
Returns:Is object untracable. ( Boolean )
foundations.trace.setTraced(object)[source]

This definition sets given object as traced.

Parameters:object – Object. ( Object )
Returns:Definition success. ( Boolean )
foundations.trace.setUntraced(object)[source]

This definition sets given object as untraced.

Parameters:object – Object. ( Object )
Returns:Definition success. ( Boolean )
foundations.trace.setUntracable(object)[source]

This definition sets given object as untraced.

Parameters:object – Object. ( Object )
Returns:Definition success. ( Boolean )
foundations.trace.traceWalker(module)[source]

This definition is a generator used to walk into modules.

Parameters:module – Module to walk. ( Module )
Returns:Class / Function / Method. ( Object / Object )
foundations.trace.getObjectName(object)[source]

This definition returns given object name.

Parameters:object – Object to retrieve the name. ( Object )
Returns:Object name. ( String )
foundations.trace.getTraceName(object)[source]

This definition returns given object trace name.

Parameters:object – Object. ( Object )
Returns:Object trace name. ( String )
foundations.trace.getMethodName(method)[source]

This definition returns given method name.

Parameters:method – Method to retrieve the name. ( Object )
Returns:Method name. ( String )
foundations.trace.isStaticMethod(method)[source]

This definition returns if given method is a static method.

Parameters:method – Method. ( Object )
Returns:Is static method. ( Boolean )
foundations.trace.isClassMethod(method)[source]

This definition returns if given method is a class method.

Parameters:method – Method. ( Object )
Returns:Is class method. ( Boolean )
foundations.trace.formatArgument(argumentValue)[source]

This definition returns a string representing an argument / value pair.

Usage:

>>> formatArgument(('x', (0, 1, 2)))
'x=(0, 1, 2)'
Parameters:argumentValue – Argument / value pair. ( Tuple )
Returns:Formatted .argument / value pair. ( String )
foundations.trace.validateTracer(*args)[source]

This definition is used to validate and finish a tracer by adding mandatory extra attributes.

Parameters:*args – Arguments. ( * )
Returns:Validated wrapped object. ( Object )
foundations.trace.tracer(object)[source]
This decorator object is used for execution tracing.
Any method / definition decorated will have it’s execution traced.
Parameters:object – Object to decorate. ( Object )
Returns:Object. ( Object )
foundations.trace.untracer(object)[source]

This definition object is used to untrace given object.

Parameters:object – Object to untrace. ( Object )
Returns:Untraced object. ( Object )
foundations.trace.untracable(object)[source]

This decorator object is used to mark decorated object as non tracable.

Parameters:object – Object to decorate. ( Object )
Returns:Object. ( Object )
foundations.trace.traceFunction(module, function, tracer=<function tracer at 0x103c442a8>)[source]

This definition traces given module function using given tracer.

Parameters:
  • module – Module of the function. ( Object )
  • function – Function to trace. ( Object )
  • tracer – Tracer. ( Object )
Returns:

Definition success. ( Boolean )

foundations.trace.untraceFunction(module, function)[source]

This definition untraces given module function.

Parameters:
  • module – Module of the function. ( Object )
  • function – Function to untrace. ( Object )
Returns:

Definition success. ( Boolean )

foundations.trace.traceMethod(cls, method, tracer=<function tracer at 0x103c442a8>)[source]

This definition traces given class method using given tracer.

Parameters:
  • cls – Class of the method. ( Object )
  • method – Method to trace. ( Object )
  • tracer – Tracer. ( Object )
Returns:

Definition success. ( Boolean )

foundations.trace.untraceMethod(cls, method)[source]

This definition untraces given class method.

Parameters:
  • cls – Class of the method. ( Object )
  • method – Method to untrace. ( Object )
Returns:

Definition success. ( Boolean )

foundations.trace.traceProperty(cls, accessor, tracer=<function tracer at 0x103c442a8>)[source]

This definition traces given class property using given tracer.

Parameters:
  • cls – Class of the property. ( Object )
  • accessor – Property to trace. ( Property )
  • tracer – Tracer. ( Object )
Returns:

Definition success. ( Boolean )

foundations.trace.untraceProperty(cls, accessor)[source]

This definition untraces given class property.

Parameters:
  • cls – Class of the property. ( Object )
  • accessor – Property to untrace. ( Property )
Returns:

Definition success. ( Boolean )

foundations.trace.traceClass(cls, tracer=<function tracer at 0x103c442a8>, pattern='.*', flags=0)[source]

This definition traces given class using given tracer.

Parameters:
  • cls – Class to trace. ( Object )
  • tracer – Tracer. ( Object )
  • pattern – Matching pattern. ( String )
  • flags – Matching regex flags. ( Integer )
Returns:

Definition success. ( Boolean )

foundations.trace.untraceClass(cls)[source]

This definition untraces given class.

Parameters:cls – Class to untrace. ( Object )
Returns:Definition success. ( Boolean )
foundations.trace.traceModule(module, tracer=<function tracer at 0x103c442a8>, pattern='.*', flags=0)[source]

This definition traces given module members using given tracer.

Parameters:
  • module – Module to trace. ( Module )
  • tracer – Tracer. ( Object )
  • pattern – Matching pattern. ( String )
  • flags – Matching regex flags. ( Integer )
Returns:

Definition success. ( Boolean )

Note :

Only members exported by __all__ attribute will be traced.

foundations.trace.untraceModule(module)[source]

This definition untraces given module members.

Parameters:module – Module to untrace. ( Module )
Returns:Definition success. ( Boolean )
foundations.trace.registerModule(module=None)[source]

This definition registers given module or caller introspected module in the candidates modules for tracing.

Parameters:module – Module to register. ( Module )
Returns:Definition success. ( Boolean )
foundations.trace.installTracer(tracer=<function tracer at 0x103c442a8>, pattern='.*', flags=0)[source]

This definition installs given tracer in the candidates modules for tracing matching given pattern.

Parameters:
  • tracer – Tracer. ( Object )
  • pattern – Matching pattern. ( String )
  • flags – Matching regex flags. ( Integer )
Returns:

Definition success. ( Boolean )

foundations.trace.uninstallTracer(pattern='.*', flags=0)[source]

This definition installs the tracer in the candidates modules for tracing matching given pattern.

Parameters:
  • pattern – Matching pattern. ( String )
  • flags – Matching regex flags. ( Integer )
Returns:

Definition success. ( Boolean )

foundations.trace.evaluateTraceRequest(data, tracer=<function tracer at 0x103c442a8>)[source]

This definition evaluate given string trace request.

Usage:

Umbra -t "{'umbra.engine' : ('.*', 0), 'umbra.preferences' : (r'.*', 0)}"
Umbra -t "['umbra.engine', 'umbra.preferences']"
Umbra -t "'umbra.engine, umbra.preferences"
Parameters:
  • data – Trace request. ( String )
  • tracer – Tracer. ( Object )
Returns:

Definition success. ( Boolean )

Table Of Contents

Previous topic

4.17. foundations.tcpServer

Next topic

4.19. foundations.ui.common

This Page