[UPD] script check addons exist: show different error when multiple module

- this permit to know if multiple same module or missing module
- ignore warning when ask for module path
This commit is contained in:
Mathieu Benoit 2024-03-17 14:00:27 -04:00
parent b38d67e35a
commit edbf898136

View file

@ -22,6 +22,7 @@ def get_config():
formatter_class=argparse.RawDescriptionHelpFormatter, formatter_class=argparse.RawDescriptionHelpFormatter,
description="""\ description="""\
Check if module exist and is not multiple here to manage conflict. Check if module exist and is not multiple here to manage conflict.
Return 0 if success, return 1 if missing module, return 2 if multiple same module
""", """,
epilog="""\ epilog="""\
""", """,
@ -93,8 +94,10 @@ def main():
lst_module_not_exist.append(module) lst_module_not_exist.append(module)
is_good = True is_good = True
error_missing_module = False
if lst_module_not_exist: if lst_module_not_exist:
is_good = False is_good = False
error_missing_module = True
module_list = "'" + "', '".join(lst_module_not_exist) + "'" module_list = "'" + "', '".join(lst_module_not_exist) + "'"
_logger.error( _logger.error(
"Missing" "Missing"
@ -114,7 +117,7 @@ def main():
for value in lst_value: for value in lst_value:
print(value) print(value)
if dct_module_exist_empty: if dct_module_exist_empty and not config.output_path:
for key, lst_value in dct_module_exist_empty.items(): for key, lst_value in dct_module_exist_empty.items():
module_list = "'" + "', '".join(lst_value) + "'" module_list = "'" + "', '".join(lst_value) + "'"
_logger.warning( _logger.warning(
@ -122,7 +125,11 @@ def main():
f" {module_list}" f" {module_list}"
) )
return 0 if is_good else -1 if not is_good:
if error_missing_module:
return 1
return 2
return 0
if __name__ == "__main__": if __name__ == "__main__":