Example #1
0
    def runPackage(self):
        self.log.indent()
        testType = self.getConfigSetting("base/type", "standalone")

        if testType == "remote" and "testRun" in self.configuration:
            jUrl = self.getConfigSetting("testRun/host", "")
            jUrl += self.getConfigSetting("testRun/qxPath", "")
            jUrl += "buildStatus.json"
            try:
                self.buildStatus = util.getJsonFromUrl(jUrl)
            except Exception, e:
                self.log.error("Error while getting remote build status: " + str(e))
    def runPackage(self):
        self.log.indent()
        testType = self.getConfigSetting("base/type", "standalone")

        if testType == "remote" and "testRun" in self.configuration:
            jUrl = self.getConfigSetting("testRun/host", "")
            jUrl += self.getConfigSetting("testRun/qxPath", "")
            jUrl += "buildStatus.json"
            try:
                self.buildStatus = util.getJsonFromUrl(jUrl)
            except Exception, e:
                self.log.error("Error while getting remote build status: " +
                               str(e))
Example #3
0
    def runPackage(self):
        testType = self.getConfigSetting("base/type", "standalone")
        
        self.buildStatus = {}

        if testType == "remote" and "testRun" in self.configuration:
            jUrl = self.getConfigSetting("testRun/host", "")
            jUrl += self.getConfigSetting("testRun/qxPath", "")
            jUrl += "buildStatus.json"
            self.buildStatus = util.getJsonFromUrl(jUrl)
        
        if testType == "local":
            try:
                buildStatusFile = os.path.join(self.config["build"]["stageDir"], "trunk", "qooxdoo", "buildStatus.json")
                self.buildStatus = Builder.getBuildStatusFromFile(buildStatusFile)
            except Exception, e:
                pass  
Example #4
0
    def get(self, id=0):
        row = Contacto.query.get(id)

        if row is None:
            self.response["error"] = True
            self.response["message"] = "No se ha encontrado informacion."

        data = []
        data = {
            "alias": row.getAlias(),
            "ruc": row.ruc,
            "razon": row.getRazon(),
            "direccion": row.direccion,
            "departamento": row.getDepartamento(),
            "provincia": row.getProvincia(),
            "distrito": row.getDistrito()
        }

        data["personas"] = []
        for persona in row.getPersonas():
            data["personas"].append({
                "nombre": persona.nombre,
                "telefono": persona.telefono,
                "correo": persona.correo
            })

        if row.direccion:
            direccion = data['direccion'].replace(
                " ", "+") + "+" + data['distrito'].replace(
                    " ", "+") + "+" + data['provincia'].replace(
                        " ", "+") + "+" + data['departamento'].replace(
                            " ", "+")
            google_maps_key = "AIzaSyCKAP5TL-tLyhRqtUC1rLYg_kReI5cnz6M"
            url = "https://maps.googleapis.com/maps/api/geocode/json?address=" + direccion + "+PE&key=" + google_maps_key
            p = getJsonFromUrl(url)
            if not p is None:
                if p.status == 'OK':
                    lat = p.results[0].geometry.location.lat
                    lng = p.results[0].geometry.location.lng
                    data["location"] = {"lat": lat, "lng": lng}

        self.response["data"] = data

        return jsonify(self.response)
Example #5
0
	def get(self, id=0):
		row = Contacto.query.get(id)

		if row is None:
			self.response["error"] = True
			self.response["message"] = "No se ha encontrado informacion."

		data = []
		data = {
			"alias": row.getAlias(),
			"ruc": row.ruc,
			"razon": row.getRazon(),
			"direccion": row.direccion,
			"departamento": row.getDepartamento(),
			"provincia": row.getProvincia(),
			"distrito": row.getDistrito()
		}

		data["personas"] = []
		for persona in row.getPersonas():
			data["personas"].append({
				"nombre": persona.nombre,
				"telefono": persona.telefono,
				"correo": persona.correo
			})

		if row.direccion:
			direccion = data['direccion'].replace(" ", "+")+"+"+data['distrito'].replace(" ", "+")+"+"+data['provincia'].replace(" ", "+")+"+"+data['departamento'].replace(" ", "+")
			google_maps_key = "AIzaSyCKAP5TL-tLyhRqtUC1rLYg_kReI5cnz6M"
			url = "https://maps.googleapis.com/maps/api/geocode/json?address="+direccion+"+PE&key="+google_maps_key
			p = getJsonFromUrl(url)
			if not p is None:
				if p.status=='OK':
					lat = p.results[0].geometry.location.lat
					lng = p.results[0].geometry.location.lng
					data["location"] = {
						"lat": lat,
						"lng": lng
					}

		self.response["data"] = data

		return jsonify(self.response)
Example #6
0
def getCurrentPatch():
    # patchByRegion = "https://ddragon.leagueoflegends.com/realms/na.json"
    currentPatch = "https://ddragon.leagueoflegends.com/api/versions.json"
    patchInfo = util.getJsonFromUrl(currentPatch)
    return patchInfo[0]
Example #7
0
def updateChampions():
    champions = util.getJsonFromUrl(getChampionUrl())
    util.saveJSON("champions.json", champions)