本文整理汇总了Python中utils.dotdict.DotDict.agps_data方法的典型用法代码示例。如果您正苦于以下问题:Python DotDict.agps_data方法的具体用法?Python DotDict.agps_data怎么用?Python DotDict.agps_data使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类utils.dotdict.DotDict
的用法示例。
在下文中一共展示了DotDict.agps_data方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: handle_request
# 需要导入模块: from utils.dotdict import DotDict [as 别名]
# 或者: from utils.dotdict.DotDict import agps_data [as 别名]
def handle_request(self, data):
try:
packet = T_CLWCheck(data)
command = packet.head.command
if command == GATEWAY.T_MESSAGE_TYPE.AGPS:
head = packet.head
body = packet.body
args = DotDict(success=GATEWAY.RESPONSE_STATUS.SUCCESS,
agps_data=None)
ap = AgpsParser(body, head)
agps_sign = self.get_agps_sign(ap.ret, int(head.timestamp))
if agps_sign != int(head.agps_sign, 16):
args.success = GATEWAY.RESPONSE_STATUS.INVALID_SESSIONID
logging.error("[AGPS] agps_sign invalid.")
else:
agps = ap.ret
args.agps_data = self.get_agps_from_redis(agps)
if args.agps_data:
ac = AgpsComposer(args)
return ac.buf
else:
logging.error("[AGPS] there's no invalid agps data.")
return None
except:
logging.exception("[AGPS] Handle agps request exception.")
return None