def setupOneAsset(self, jsonHash):
assetDir = os.path.join(self.root,str(jsonHash["nid"]))
if not os.path.exists(assetDir):
os.makedirs(assetDir)
if "files" in jsonHash.keys():
files = jsonHash["files"]
if "render" in files.keys():
#fn = os.path.join(assetDir,"screenshot.png")
fn = self.getScreenshotPath(jsonHash)
if not os.path.exists(fn):
#log.debug("Downloading " + files["render"])
self.downloadUrl(files["render"],fn)
else:
log.debug("Screenshot already existed")
if "thumb" in files.keys():
fn = os.path.join(assetDir,"thumb.png")
if not os.path.exists(fn):
log.debug("Downloading " + files["thumb"])
self.downloadUrl(files["thumb"],fn)
else:
log.debug("thumb already existed")
assetdownload.py 文件源码
python
阅读 26
收藏 0
点赞 0
评论 0
评论列表
文章目录