本文整理匯總了Python中pyload.webui.PYLOAD.getPackageData方法的典型用法代碼示例。如果您正苦於以下問題:Python PYLOAD.getPackageData方法的具體用法?Python PYLOAD.getPackageData怎麽用?Python PYLOAD.getPackageData使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類pyload.webui.PYLOAD
的用法示例。
在下文中一共展示了PYLOAD.getPackageData方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。
示例1: package
# 需要導入模塊: from pyload.webui import PYLOAD [as 別名]
# 或者: from pyload.webui.PYLOAD import getPackageData [as 別名]
def package(id):
try:
data = toDict(PYLOAD.getPackageData(id))
data['links'] = [toDict(x) for x in data['links']]
for pyfile in data['links']:
if pyfile['status'] == 0:
pyfile['icon'] = "status_finished.png"
elif pyfile['status'] in (2, 3):
pyfile['icon'] = "status_queue.png"
elif pyfile['status'] in (9, 1):
pyfile['icon'] = "status_offline.png"
elif pyfile['status'] == 5:
pyfile['icon'] = "status_waiting.png"
elif pyfile['status'] == 8:
pyfile['icon'] = "status_failed.png"
elif pyfile['status'] == 4:
pyfile['icon'] = "arrow_right.png"
elif pyfile['status'] in (11, 13):
pyfile['icon'] = "status_proc.png"
else:
pyfile['icon'] = "status_downloading.png"
tmp = data['links']
tmp.sort(key=get_sort_key)
data['links'] = tmp
return data
except Exception:
traceback.print_exc()
return HTTPError()