本文整理汇总了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()