From ec3c2df54e5c2c229809b379ffe0f21aec91e077 Mon Sep 17 00:00:00 2001 From: Gerald Vincent Date: Thu, 21 Sep 2023 09:53:59 +0200 Subject: [PATCH] Exlude hidden dirs when wakling through script definition --- src/config/config_service.py | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/config/config_service.py b/src/config/config_service.py index 9e5c1324..083360ee 100644 --- a/src/config/config_service.py +++ b/src/config/config_service.py @@ -262,9 +262,17 @@ def load_config_model(self, name, user, parameter_values=None, skip_invalid_para def _visit_script_configs(self, visitor): configs_dir = self._script_configs_folder + # We will ignore folders with this prefixes (ie: hidden folders) + exclude_prefixes=('.') + files = [] # Read config file from within directories too for _root, _dirs, _files in os.walk(configs_dir, topdown=True): + # In place exlustion of _dirs with exlusion prefixes + _dirs[:] = [_dirs + for _dirs in _dirs + if not _dirs.startswith(exclude_prefixes)] + for name in _files: files.append(os.path.join(_root, name))