motu_api.py 文件源码

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

项目:motu-client-python 作者: clstoulouse 项目源码 文件源码
def get_requestUrl(dl_url, server, **options):
    """ Get the request url."""    
    stopWatch = stop_watch.localThreadStopWatch()    
    start_time = datetime.datetime.now()
    stopWatch.start('get_request')
    log.info( "Requesting file to download (this can take a while)..." ) 

    # Get request id        
    m = utils_http.open_url(dl_url, **options)
    responseStr = m.read()
    dom = minidom.parseString(responseStr)
    node = dom.getElementsByTagName('statusModeResponse')[0]
    status = node.getAttribute('status')
    if status == "2":
        msg = node.getAttribute('msg')
        log.error(msg)
        get_req_url = None
    else:
        requestId = node.getAttribute('requestId')
        # Get request url
        get_req_url = server + '?action=getreqstatus&requestid=' + requestId

    stopWatch.stop('get_request')

    return get_req_url
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号