Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
@staticmethod
def query_skyhook(bssid):
Logger.log_more_verbose(
"Querying Skyhook for: %s" % bssid)
try:
r = Skyhook().locate(bssid)
if r:
xml = ET.fromstring(r)
ns = "{http://skyhookwireless.com/wps/2005}"
err = xml.find(".//%serror" % ns)
if err is not None:
Logger.log_error_verbose(
"Response from Skyhook: %s" % err.text)
return
return {
"latitude": float(xml.find(".//%slatitude" % ns).text),
"longitude": float(xml.find(".//%slongitude" % ns).text),
"hpe": float(xml.find(".//%shpe" % ns).text),
"state": xml.find(".//%sstate" % ns).text,
"state_code": xml.find(".//%sstate" % ns).get("code"),
"country": xml.find(".//%scountry" % ns).text,
"country_code": xml.find(".//%scountry" % ns).get("code"),
@staticmethod
def query_skyhook(bssid):
Logger.log_more_verbose(
"Querying Skyhook for: %s" % bssid)
try:
r = Skyhook().locate(bssid)
if r:
xml = ET.fromstring(r)
ns = "{http://skyhookwireless.com/wps/2005}"
err = xml.find(".//%serror" % ns)
if err is not None:
Logger.log_error_verbose(
"Response from Skyhook: %s" % err.text)
return
return {
"latitude": float(xml.find(".//%slatitude" % ns).text),
"longitude": float(xml.find(".//%slongitude" % ns).text),
"hpe": float(xml.find(".//%shpe" % ns).text),
"state": xml.find(".//%sstate" % ns).text,
"state_code": xml.find(".//%sstate" % ns).get("code"),
"country": xml.find(".//%scountry" % ns).text,
"country_code": xml.find(".//%scountry" % ns).get("code"),