Пример #1
0
    def load_pdc(self):
        try:
            doc = xml_parse(
                Directories.resolveFilename(Directories.SCOPE_CONFIG,
                                            "vps.xml"))
            xmlroot = doc.getroot()

            if xmlroot is not None:
                for xml in xmlroot.findall("channel"):
                    serviceref = xml.get("serviceref")
                    serviceref = six.ensure_str(serviceref)
                    has_pdc = xml.get("has_pdc")
                    last_check = xml.get("last_check")
                    default_vps = xml.get("default_vps")
                    self.checked_services[serviceref] = {}
                    self.checked_services[serviceref]["last_check"] = int(
                        last_check)
                    self.checked_services[serviceref]["has_pdc"] = int(has_pdc)
                    if default_vps and default_vps != "None":
                        self.checked_services[serviceref]["default_vps"] = int(
                            default_vps)
                    else:
                        self.checked_services[serviceref]["default_vps"] = 0
        except:
            pass
Пример #2
0
    def _apps1_project_is_default(self, project, config_name):
        """
        Determine if the config_name build configuration is the default build
        configuration in the .x2p apps1 project.
        """
        proj_xml = xml_parse(project).getroot()
        configurations = proj_xml.findall("configurations")
        if len(configurations) != 1:
            raise RuntimeError("Multiple configurations elements in %s" % project)
        configuration = configurations[0].findall("configuration")

        for config in configuration:
            if config.attrib["name"] == config_name:
                if "default" in config.attrib["options"]:
                    return True

        return False
Пример #3
0
	def load_pdc(self):
		try:
			doc = xml_parse(Directories.resolveFilename(Directories.SCOPE_CONFIG, "vps.xml"))
			xmlroot = doc.getroot()
			
			if xmlroot is not None:
				for xml in xmlroot.findall("channel"):
					serviceref = xml.get("serviceref").encode("utf-8")
					has_pdc = xml.get("has_pdc")
					last_check = xml.get("last_check")
					default_vps = xml.get("default_vps")
					self.checked_services[serviceref] = { }
					self.checked_services[serviceref]["last_check"] = int(last_check)
					self.checked_services[serviceref]["has_pdc"] = int(has_pdc)
					if default_vps and default_vps != "None":
						self.checked_services[serviceref]["default_vps"] = int(default_vps)
					else:
						self.checked_services[serviceref]["default_vps"] = 0
		except:
			pass