def get_value(self, name, attributes=None, resolved=True, subgroup=None): """ Get Value of fields in the config_machines.xml file """ expect(self.machine_node is not None, "Machine object has no machine defined") expect(subgroup is None, "This class does not support subgroups") value = None # COMPILER and MPILIB are special, if called without arguments they get the default value from the # COMPILERS and MPILIBS lists in the file. if name == "COMPILER": value = self.get_default_compiler() elif name == "MPILIB": value = self.get_default_MPIlib(attributes) else: node = self.get_optional_node(name, root=self.machine_node, attributes=attributes) if node is not None: value = node.text if value is None: # if all else fails value = GenericXML.get_value(self, name) if resolved: if value is not None: value = self.get_resolved_value(value) elif name in os.environ: value = os.environ[name] value = convert_to_unknown_type(value) return value
def get_value(self, name, attributes=None, resolved=True, subgroup=None): """ Get Value of fields in the config_machines.xml file """ expect(self.machine_node is not None, "Machine object has no machine defined") expect(subgroup is None, "This class does not support subgroups") value = None if name in self.custom_settings: return self.custom_settings[name] # COMPILER and MPILIB are special, if called without arguments they get the default value from the # COMPILERS and MPILIBS lists in the file. if name == "COMPILER": value = self.get_default_compiler() elif name == "MPILIB": value = self.get_default_MPIlib(attributes) else: node = self.get_optional_child(name, root=self.machine_node, attributes=attributes) if node is not None: value = self.text(node) if resolved: if value is not None: value = self.get_resolved_value(value) elif name in os.environ: value = os.environ[name] value = convert_to_unknown_type(value) return value