forked from espressif/esp-idf
Run global_action_callbacks in predictable order
This commit is contained in:
@ -647,7 +647,7 @@ def init_cli(verbose_output=None):
|
|||||||
idf_py_extensions_path = os.path.join(os.environ["IDF_PATH"], "tools", "idf_py_actions")
|
idf_py_extensions_path = os.path.join(os.environ["IDF_PATH"], "tools", "idf_py_actions")
|
||||||
extra_paths = os.environ.get("IDF_EXTRA_ACTIONS_PATH", "").split(';')
|
extra_paths = os.environ.get("IDF_EXTRA_ACTIONS_PATH", "").split(';')
|
||||||
extension_dirs = [idf_py_extensions_path] + extra_paths
|
extension_dirs = [idf_py_extensions_path] + extra_paths
|
||||||
extensions = {}
|
extensions = []
|
||||||
|
|
||||||
for directory in extension_dirs:
|
for directory in extension_dirs:
|
||||||
if directory and not os.path.exists(directory):
|
if directory and not os.path.exists(directory):
|
||||||
@ -657,20 +657,20 @@ def init_cli(verbose_output=None):
|
|||||||
sys.path.append(directory)
|
sys.path.append(directory)
|
||||||
for _finder, name, _ispkg in sorted(iter_modules([directory])):
|
for _finder, name, _ispkg in sorted(iter_modules([directory])):
|
||||||
if name.endswith('_ext'):
|
if name.endswith('_ext'):
|
||||||
extensions[name] = import_module(name)
|
extensions.append((name, import_module(name)))
|
||||||
|
|
||||||
# Load component manager if available and not explicitly disabled
|
# Load component manager if available and not explicitly disabled
|
||||||
if os.getenv('IDF_COMPONENT_MANAGER', None) != '0':
|
if os.getenv('IDF_COMPONENT_MANAGER', None) != '0':
|
||||||
try:
|
try:
|
||||||
from idf_component_manager import idf_extensions
|
from idf_component_manager import idf_extensions
|
||||||
|
|
||||||
extensions['component_manager_ext'] = idf_extensions
|
extensions.append(('component_manager_ext', idf_extensions))
|
||||||
os.environ['IDF_COMPONENT_MANAGER'] = '1'
|
os.environ['IDF_COMPONENT_MANAGER'] = '1'
|
||||||
|
|
||||||
except ImportError:
|
except ImportError:
|
||||||
pass
|
pass
|
||||||
|
|
||||||
for name, extension in extensions.items():
|
for name, extension in extensions:
|
||||||
try:
|
try:
|
||||||
all_actions = merge_action_lists(all_actions, extension.action_extensions(all_actions, project_dir))
|
all_actions = merge_action_lists(all_actions, extension.action_extensions(all_actions, project_dir))
|
||||||
except AttributeError:
|
except AttributeError:
|
||||||
|
Reference in New Issue
Block a user