From 434f140a0af96e21412c3cbe92508e7a302b002a Mon Sep 17 00:00:00 2001 From: crouzet Date: Wed, 16 Mar 2022 15:46:49 +0100 Subject: [PATCH] small patch to allow to choose the complementary property --- src/product.py | 30 +++++++++++++++++++++--------- 1 file changed, 21 insertions(+), 9 deletions(-) diff --git a/src/product.py b/src/product.py index 90879ea..290d382 100644 --- a/src/product.py +++ b/src/product.py @@ -797,15 +797,27 @@ def get_products_list(options, cfg, logger): ko = [] res =[] prop, value = options.properties # for example 'is_SALOME_module', 'yes' - for p_name, p_info in resAll: - try: - if p_info.properties[prop] == value: - res.append((p_name, p_info)) - ok.append(p_name) - else: - ko.append(p_name) - except: - ko.append(p_name) + if value[0] == '!': + for p_name, p_info in resAll: + try: + if p_info.properties[prop] == value[1:]: + ko.append(p_name) + else: + res.append((p_name, p_info)) + ok.append(p_name) + except: + res.append((p_name, p_info)) + ok.append(p_name) + else: + for p_name, p_info in resAll: + try: + if p_info.properties[prop] == value: + res.append((p_name, p_info)) + ok.append(p_name) + else: + ko.append(p_name) + except: + ko.append(p_name) if len(ok) != len(resAll): logger.trace("on properties %s\n products accepted:\n %s\n products rejected:\n %s\n" % -- 2.39.2