From 2f73a67227a6e5c6915803304cdc653dad6d4fa2 Mon Sep 17 00:00:00 2001 From: Mathieu Benoit Date: Fri, 3 Feb 2023 03:10:28 -0500 Subject: [PATCH] [FIX] script pycharm_configuration: support iml when contain 1 component --- script/ide/pycharm_configuration.py | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/script/ide/pycharm_configuration.py b/script/ide/pycharm_configuration.py index 0d197e7..119492a 100755 --- a/script/ide/pycharm_configuration.py +++ b/script/ide/pycharm_configuration.py @@ -340,9 +340,17 @@ def add_exclude_folder(dct_xml, file_name, config): die( not bool(lst_component), f"Missing 'module/component' into {file_name}" ) - dct_component = [ - a for a in lst_component if a.get("@name") == "NewModuleRootManager" - ] + if type(lst_component) is list: + dct_component = [ + a + for a in lst_component + if a.get("@name") == "NewModuleRootManager" + ] + elif type(lst_component) is dict: + dct_component = [lst_component] + else: + raise Exception(f"Wrong value for {lst_component}") + die( not bool(dct_component), "Missing 'module/component @name NewModuleRootManager' into"