Skip to content

Commit 8fe854c

Browse files
authored
Silence installer log messages (#181)
1 parent 10fc66b commit 8fe854c

File tree

3 files changed

+13
-5
lines changed

3 files changed

+13
-5
lines changed

builder/frameworks/arduino.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -121,7 +121,7 @@ def _get_installed_pip_packages():
121121
env.Execute(
122122
env.VerboseAction(
123123
(
124-
'"$PYTHONEXE" -m pip install -U '
124+
'"$PYTHONEXE" -m pip install -U -q -q -q '
125125
+ " ".join(
126126
[
127127
'"%s%s"' % (p, deps[p])

builder/frameworks/espidf.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -106,7 +106,7 @@ def _get_installed_standard_pip_packages():
106106
env.Execute(
107107
env.VerboseAction(
108108
(
109-
'"$PYTHONEXE" -m pip install -U '
109+
'"$PYTHONEXE" -m pip install -U -q -q -q '
110110
+ " ".join(
111111
[
112112
'"%s%s"' % (p, deps[p])
@@ -1559,7 +1559,7 @@ def _get_installed_pip_packages(python_exe_path):
15591559
env.Execute(
15601560
env.VerboseAction(
15611561
(
1562-
'"%s" -m pip install -U ' % python_exe_path
1562+
'"%s" -m pip install -U -q -q -q ' % python_exe_path
15631563
+ " ".join(['"%s%s"' % (p, deps[p]) for p in packages_to_install])
15641564
),
15651565
"Installing ESP-IDF's Python dependencies",
@@ -1569,7 +1569,7 @@ def _get_installed_pip_packages(python_exe_path):
15691569
if IS_WINDOWS and "windows-curses" not in installed_packages:
15701570
env.Execute(
15711571
env.VerboseAction(
1572-
'"%s" -m pip install windows-curses' % python_exe_path,
1572+
'"%s" -m pip install -q -q -q windows-curses' % python_exe_path,
15731573
"Installing windows-curses package",
15741574
)
15751575
)

platform.py

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@
1313
# limitations under the License.
1414

1515
import os
16+
import contextlib
1617
import requests
1718
import json
1819
import subprocess
@@ -68,7 +69,14 @@ def install_tool(TOOL, retry_count=0):
6869
json_flag = bool(os.path.exists(TOOLS_JSON_PATH))
6970
pio_flag = bool(os.path.exists(TOOLS_PIO_PATH))
7071
if tl_flag and json_flag:
71-
rc = subprocess.run(IDF_TOOLS_CMD).returncode
72+
with open(os.devnull, 'w') as devnull, \
73+
contextlib.redirect_stdout(devnull), \
74+
contextlib.redirect_stderr(devnull):
75+
rc = subprocess.run(
76+
IDF_TOOLS_CMD,
77+
stdout=subprocess.DEVNULL,
78+
stderr=subprocess.DEVNULL
79+
).returncode
7280
if rc != 0:
7381
sys.stderr.write("Error: Couldn't execute 'idf_tools.py install'\n")
7482
else:

0 commit comments

Comments
 (0)