xonsh.execer#

Implements the xonsh executer.

class xonsh.execer.Execer(filename='<xonsh-code>', debug_level=0, parser_args=None, scriptcache=True, cacheall=False)[source]#

Executes xonsh code in a context.

Parameters:
filenamestr, optional

File we are to execute.

debug_levelint, optional

Debugging level to use in lexing and parsing.

parser_argsdict, optional

Arguments to pass down to the parser.

scriptcachebool, optional

Whether or not to use a precompiled bytecode cache when execing code, default: True.

cacheallbool, optional

Whether or not to cache all xonsh code, and not just files. If this is set to true, it will cache command line input too, default: False.

compile(input, mode='exec', glbs=None, locs=None, stacklevel=2, filename=None, transform=True, compile_empty_tree=True)[source]#

Compiles xonsh code into a Python code object, which may then be execed or evaled.

eval(input, glbs=None, locs=None, stacklevel=2, filename=None, transform=True)[source]#

Evaluates (and returns) xonsh code.

exec(input, mode='exec', glbs=None, locs=None, stacklevel=2, filename=None, transform=True)[source]#

Execute xonsh code.

parse(input, ctx, mode='exec', filename=None, transform=True)[source]#

Parses xonsh code in a context-aware fashion. For context-free parsing, please use the Parser class directly or pass in transform=False.