boxAgent.py 文件源码

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

项目:Mohou_Box-master 作者: mohou 项目源码 文件源码
def getCurrentBoxInfo():
    url = client.protocol + client.localHostPort + "/status"
    logging.debug("getCurrentBoxInfo: Start to get current box info. url=%s", url)
    cur_client = HTTPClient()
    response = cur_client.fetch(url, request_timeout=10)
    if response.error:
        logging.warn("getCurrentBoxInfo: Failed to get current box info. error=%s", response.error)
        return None

    logging.debug("getCurrentBoxInfo: Current box info. reponse.body=%r", response.body)
    res = json_decode(response.body)
    if res["code"] != 0:
        logging.warn("getCurrentBoxInfo: Failed to get current box info. ret_value=%d", res["ret_value"])
        return None

    logging.debug("getCurrentBoxInfo: getstate cmd ver. app_ver=%s", res["data"]["app_ver"])

    return res["data"]
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号