xonsh.tracer#
Implements a xonsh tracer.
- class xonsh.tracer.TracerAlias(threadable=True, **kwargs)[source]#
Tool for tracing xonsh code as it runs.
- exception Error(message: str, errno=1)#
Special case, when raised, the traceback will not be shown. Instead the process with exit with error code and message
- with_traceback()#
Exception.with_traceback(tb) – set self.__traceback__ to tb and return self.
- args#
- create_parser(func=None, has_args=False, allowed_params=None, **kwargs)#
create root parser
- err(*args, **kwargs)#
Write text to error stream
- hook_post_add_argument(*, parser: xonsh.cli_utils.ArgParser | argparse.ArgumentParser, action: argparse.Action, param: str, func: Callable)#
Hook into parser.add_argument step.
Can be used to update action’s attributes
- hook_pre_add_argument(param: str, func, flags, kwargs)#
Hook to update arguments that are passed to parser.add_argument
- out(*args, **kwargs)#
Write text to output stream
- write_to(stream: str, *args, **kwargs)#
- xonsh_complete(command, **kwargs)#
- property parser#
- class xonsh.tracer.TracerType(*args, **kwargs)[source]#
Represents a xonsh tracer object, which keeps track of all tracing state. This is a singleton.
- off_files(_args, files: Iterable[str] = ('__file__',))[source]#
removes selected files fom tracing.
- Parameters
- files
file paths to stop watching, use
__file__
(default) to select the current file.
- on_files(_args, files: Iterable[str] = ('__file__',))[source]#
begins tracing selected files.
- Parameters
- _args
argv from alias parser
- files
file paths to watch, use “__file__” (default) to select the current file.
- toggle_color(toggle: bool = False)[source]#
output color management for tracer
- Parameters
- toggle
true/false, y/n, etc. to toggle color usage.
- valid_events = frozenset({'call', 'line'})#