mirror of
https://github.com/xonsh/xonsh.git
synced 2025-03-04 08:24:40 +01:00
wip
This commit is contained in:
parent
52c96c9dd5
commit
a769689515
2 changed files with 3 additions and 2 deletions
|
@ -1188,6 +1188,7 @@ The file should contain a function with the signature
|
||||||
)
|
)
|
||||||
XONSH_TRACE_SUBPROC = Var(
|
XONSH_TRACE_SUBPROC = Var(
|
||||||
default=always_false,
|
default=always_false,
|
||||||
|
convert=to_bool_or_int,
|
||||||
doc="Set to ``True`` or ``1`` to show arguments list of every executed subprocess command. "
|
doc="Set to ``True`` or ``1`` to show arguments list of every executed subprocess command. "
|
||||||
"Use ``2`` to have full specification.",
|
"Use ``2`` to have full specification.",
|
||||||
)
|
)
|
||||||
|
|
|
@ -887,14 +887,14 @@ def run_subproc(cmds, captured=False, envs=None):
|
||||||
|
|
||||||
specs = cmds_to_specs(cmds, captured=captured, envs=envs)
|
specs = cmds_to_specs(cmds, captured=captured, envs=envs)
|
||||||
|
|
||||||
if trace := XSH.env.get("XONSH_TRACE_SUBPROC", False):
|
if tr := XSH.env.get("XONSH_TRACE_SUBPROC", False):
|
||||||
tracer = XSH.env.get("XONSH_TRACE_SUBPROC_FUNC", None)
|
tracer = XSH.env.get("XONSH_TRACE_SUBPROC_FUNC", None)
|
||||||
if callable(tracer):
|
if callable(tracer):
|
||||||
tracer(cmds, captured=captured)
|
tracer(cmds, captured=captured)
|
||||||
else:
|
else:
|
||||||
r = {"cmds": cmds, "captured": captured}
|
r = {"cmds": cmds, "captured": captured}
|
||||||
print(f"Trace run_subproc({repr(r)})", file=sys.stderr)
|
print(f"Trace run_subproc({repr(r)})", file=sys.stderr)
|
||||||
if int(trace) == 2:
|
if tr == 2:
|
||||||
for i, s in enumerate(specs):
|
for i, s in enumerate(specs):
|
||||||
pcls = s.cls.__module__ + "." + s.cls.__name__
|
pcls = s.cls.__module__ + "." + s.cls.__name__
|
||||||
pcmd = (
|
pcmd = (
|
||||||
|
|
Loading…
Add table
Reference in a new issue