Esempio n. 1
0
async def get_remote_manifest(request):
    content = {'data': {}, 'tagdesc': {}}
    try:
        content['data'] = au.get_remote_manifest()
    except:
        traceback.print_exc()
        content = {'data': {}, 'tagdesc': {}}
    global install_queue
    temp_q = []
    while install_queue.empty() == False:
        q = install_queue.get()
        temp_q.append([q['module'], q['version']])
    for module, version in temp_q:
        content['data'][module]['queued'] = True
        install_queue.put({'module': module, 'version': version})
    try:
        counts = au.get_download_counts()
    except:
        traceback.print_exc()
        counts = {}
    for mname in content['data']:
        content['data'][mname]['downloads'] = counts.get(mname, 0)
    content['tagdesc'] = await get_tag_desc(request)
    return web.json_response(content)
Esempio n. 2
0
async def get_remote_manifest(request):
    try:
        if au.mic.remote == {}:
            au.mic.update_remote()
        content = au.mic.remote
    except:
        traceback.print_exc()
        content = {}
    global install_queue
    temp_q = []
    while install_queue.empty() == False:
        q = install_queue.get()
        temp_q.append([q['module'], q['version']])
    for module, version in temp_q:
        content[module]['queued'] = True
        install_queue.put({'module': module, 'version': version})
    try:
        counts = au.get_download_counts()
    except:
        traceback.print_exc()
        counts = {}
    for mname in content:
        content[mname]['downloads'] = counts.get(mname,0)
    return web.json_response(content)