flightAPI.py 文件源码

python
阅读 16 收藏 0 点赞 0 评论 0

项目:AirMapSDK-Embedded 作者: airmap 项目源码 文件源码
def recover_Pilot(self):

        try:
            connectFlight = httplib.HTTPSConnection(Globals.httpsAddr, Globals.httpsPort, timeout=Globals.timeOut)
            headers = Globals.xapikey
            headers['Authorization'] = "Bearer {}".format(Globals.myToken)
            connectFlight.request('GET', '/pilot/v2/profile', "", headers)
                result = connectFlight.getresponse().read()
            try:
                parsed_json = json.loads(result)
                parsed_status = parsed_json['status']
                print parsed_status
                Globals.pilot_id = parsed_json['data']['id']
                Globals.pilotIDValid = True
            except:
                Globals.strPrint (self.thisGlobals,"Pilot Recover ID not found...Retry!")
                Globals.strPrint (self.thisGlobals,result)
                return False
            if parsed_status != "success":
                return False
        except:
                print "Create Flight Error..."
            traceback.print_exc()

        return Globals.pilot_id
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号