def get_status(self,gps_lat,gps_lon,weather):
if Globals.AirConnected:
try:
self.connection = httplib.HTTPSConnection(Globals.httpsAddr, Globals.httpsPort, timeout=Globals.timeOut)
self.headers = Globals.xapikey
self.connection.request('GET', '/status/v2/point?latitude='+gps_lat+'&longitude='+gps_lon+'&weather='+weather, '', self.headers)
result = self.connection.getresponse().read()
self.status_json = json.loads(result)
Globals.strPrint (self.thisGlobals,self.status_json)
return (self.status_json['status'] == "success")
except Exception,e:
Globals.strPrint (self.thisGlobals,"Airmap: No Connection or slow connection ->Request Timeout...")
#Globals.strPrint(self.thisGlobals,str(e))
return False
else:
Globals.strPrint (self.thisGlobals,"Not Connected")
return False
评论列表
文章目录