Be in silence when debug interpreter is run

This commit is contained in:
Ivan Kravets
2018-11-29 15:21:06 +02:00
parent a485e563f0
commit 33ea6ef123

View File

@ -66,11 +66,13 @@ def on_platformio_exception(e):
def in_silence(ctx=None):
ctx = ctx or app.get_session_var("command_ctx")
assert ctx
ctx_args = ctx.args or []
return ctx_args and any([
ctx.args[0] == "upgrade", "--json-output" in ctx_args,
"--version" in ctx_args
if not ctx:
return True
return ctx.args and any([
ctx.args[0] == "debug" and "--interpreter" in " ".join(ctx.args),
ctx.args[0] == "upgrade",
"--json-output" in ctx.args,
"--version" in ctx.args
])