Skip to content

Commit 0cc5b8e

Browse files
authored
implement function create_silent_action()
1 parent 129e841 commit 0cc5b8e

File tree

1 file changed

+7
-4
lines changed

1 file changed

+7
-4
lines changed

builder/frameworks/espidf.py

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -153,6 +153,11 @@ def _get_installed_standard_pip_packages():
153153
assert os.path.isdir(FRAMEWORK_DIR)
154154
assert os.path.isdir(TOOLCHAIN_DIR)
155155

156+
def create_silent_action(action_func):
157+
"""Create a silent SCons action that suppresses output"""
158+
silent_action = env.Action(action_func)
159+
silent_action.strfunction = lambda target, source, env: ''
160+
return silent_action
156161

157162
if "arduino" in env.subst("$PIOFRAMEWORK"):
158163
ARDUINO_FRAMEWORK_DIR = platform.get_package_dir("framework-arduinoespressif32")
@@ -2196,8 +2201,7 @@ def idf_lib_copy(source, target, env):
21962201
from component_manager import ComponentManager
21972202
component_manager = ComponentManager(env)
21982203
component_manager.restore_pioarduino_build_py()
2199-
silent_action = env.Action(idf_lib_copy)
2200-
silent_action.strfunction = lambda target, source, env: '' # hack to silence scons command output
2204+
silent_action = create_silent_action(idf_lib_copy)
22012205
env.AddPostAction("checkprogsize", silent_action)
22022206

22032207
if "espidf" in env.subst("$PIOFRAMEWORK") and (flag_custom_component_add == True or flag_custom_component_remove == True):
@@ -2220,8 +2224,7 @@ def idf_custom_component(source, target, env):
22202224
from component_manager import ComponentManager
22212225
component_manager = ComponentManager(env)
22222226
component_manager.restore_pioarduino_build_py()
2223-
silent_action = env.Action(idf_custom_component)
2224-
silent_action.strfunction = lambda target, source, env: '' # hack to silence scons command output
2227+
silent_action = create_silent_action(idf_custom_component)
22252228
env.AddPostAction("checkprogsize", silent_action)
22262229
#
22272230
# Process OTA partition and image

0 commit comments

Comments
 (0)