+ """
+ res = ( "patches" in product_info and len(product_info.patches) > 0 )
+ return res
+
+def product_has_logo(product_info):
+ """Know if a product has a logo (YACSGEN generate)
+
+ :param product_info Config: The configuration specific to
+ the product
+ :return: The path of the logo if the product has a logo, else False
+ :rtype: Str
+ """
+ if ("properties" in product_info and
+ "logo" in product_info.properties):
+ return product_info.properties.logo
+ else:
+ return False
+
+def product_has_licence(product_info, path):
+ """Find out if a product has a licence
+
+ :param product_info Config: The configuration specific to the product
+ :param path Str: The path where to search for the licence
+ :return: The name of the licence file (the complete path if it is found in the path, else the name, else False
+ :rtype: Str
+ """
+ if ("properties" in product_info and
+ "licence" in product_info.properties):
+ licence_name = product_info.properties.licence
+ if len(path) > 0:
+ # search for licence_name in path
+ # a- consolidate the path into one signe string licence_path
+ licence_path=path[0]
+ for lpath in path[1:]:
+ licence_path=licence_path+":"+lpath
+ licence_path_list=licence_path.split(":")
+ licence_fullname = src.find_file_in_lpath(licence_name, licence_path_list)
+ if licence_fullname:
+ return licence_fullname
+
+ # if the search of licence in path failed, we return its name (not the full path)
+ return licence_name
+
+ else:
+ return False # product has no licence
+
+def product_has_salome_gui(product_info):
+ """Know if a product has a SALOME gui
+
+ :param product_info Config: The configuration specific to
+ the product
+ :return: True if the product has a SALOME gui, else False
+ :rtype: Boolean
+ """
+ return ("properties" in product_info and
+ "has_salome_gui" in product_info.properties and
+ product_info.properties.has_salome_gui == "yes")
+
+def product_is_mpi(product_info):
+ """Know if a product has openmpi in its dependencies
+
+ :param product_info Config: The configuration specific to
+ the product
+ :return: True if the product has openmpi inits dependencies
+ :rtype: boolean
+ """
+ return "openmpi" in product_info.depend
+
+def product_is_generated(product_info):
+ """Know if a product is generated (YACSGEN)
+
+ :param product_info Config: The configuration specific to
+ the product
+ :return: True if the product is generated
+ :rtype: boolean
+ """
+ return ("properties" in product_info and
+ "generate" in product_info.properties and
+ product_info.properties.generate == "yes")
+
+def product_is_compile_time(product_info):
+ """Know if a product is only used at compile time
+
+ :param product_info Config: The configuration specific to
+ the product
+ :return: True if the product is only used at compile time
+ :rtype: boolean
+ """
+ return ("properties" in product_info and
+ "compile_time" in product_info.properties and
+ product_info.properties.compile_time == "yes")
+
+
+def product_test_property(product_info, property_name, property_value):
+ """Generic function to test if a product has a property set to a value
+
+ :param product_info Config: The configuration specific to
+ the product
+ :param property_name : The name of the property to check
+ :param property_value : The value of the property to test
+ :return: True if the product has the property and the property is set to property_value
+ :rtype: boolean
+ """
+ # first check if product has the property
+ if not ("properties" in product_info and
+ property_name in product_info.properties):
+ return False
+
+ # then check to the property is set to property_value
+ eval_expression = 'product_info.properties.%s == "%s"' % (property_name,property_value)
+ result = eval(eval_expression)
+ return result
+
+
+
+def get_product_components(product_info):
+ """Get the component list to generate with the product
+
+ :param product_info Config: The configuration specific to
+ the product
+ :return: The list of names of the components
+ :rtype: List
+
+ """
+ if not product_is_generated(product_info):
+ return []
+
+ compo_list = []
+ if "component_name" in product_info:
+ compo_list = product_info.component_name
+
+ if isinstance(compo_list, str):
+ compo_list = [ compo_list ]
+
+ return compo_list
+def product_is_wheel(product_info):
+ """ tells whether a product is a wheel
+
+ :param product_info Config: The configuration specific to
+ the product
+ :return: True if the product has a wheel, else False
+ :rtype: Boolean
+ """
+ return ("properties" in product_info and
+ "is_wheel" in product_info.properties and
+ product_info.properties.is_wheel == "yes")
+