Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
start = imgpaths.index(pPath)
title = pPath.parent.name
else:
try:
imgpaths = extract_zip(pPath, img_types, str(outpath))
title = pPath.name
except zipfile.BadZipFile as e:
raise zipfile.BadZipfile(
f'"{path}" does not appear to be a valid zip/cbz file.'
).with_traceback(e.__traceback__)
except rarfile.BadRarFile as e:
raise rarfile.BadRarFile(
f'"{path}" does not appear to be a valid rar/cbr file.'
).with_traceback(e.__traceback__)
except py7zr.Bad7zFile as e:
raise py7zr.Bad7zFile(
f'"{path}" does not appear to be a valid 7z/cb7 file.'
).with_traceback(e.__traceback__)
else:
imgpaths = scan_directory(path, img_types)
title = pPath.name
create_out_path(outpath)
render_copy(asset_paths, outpath)
renderfile = render_from_template(
paths=imgpaths,
version=version,
title=title,
doc_template=doc_template,
page_template=page_template,
outfile=str(outpath / 'index.html'),
)
bootfile = render_bootstrap(
imgpaths = scan_directory(pPath.parent, img_types)
start = imgpaths.index(pPath)
title = pPath.parent.name
else:
try:
imgpaths = extract_zip(pPath, img_types, str(outpath))
title = pPath.name
except zipfile.BadZipFile as e:
raise zipfile.BadZipfile(
f'"{path}" does not appear to be a valid zip/cbz file.'
).with_traceback(e.__traceback__)
except rarfile.BadRarFile as e:
raise rarfile.BadRarFile(
f'"{path}" does not appear to be a valid rar/cbr file.'
).with_traceback(e.__traceback__)
except py7zr.Bad7zFile as e:
raise py7zr.Bad7zFile(
f'"{path}" does not appear to be a valid 7z/cb7 file.'
).with_traceback(e.__traceback__)
else:
imgpaths = scan_directory(path, img_types)
title = pPath.name
create_out_path(outpath)
render_copy(asset_paths, outpath)
renderfile = render_from_template(
paths=imgpaths,
version=version,
title=title,
doc_template=doc_template,
page_template=page_template,
outfile=str(outpath / 'index.html'),
)