def _is_token_expired(i):
if i.status_code == httplib.FORBIDDEN and type(i.body) == dict and i.body.get('error') is not None:
code = i.body['error'].get('code')
return code == NetatmoClient.INVALID_ACCESS_TOKEN or code == NetatmoClient.ACCESS_TOKEN_EXPIRED
else:
return False
评论列表
文章目录