docs: clarify usage of iterator in IcnsFile.verify

This commit is contained in:
relikd
2022-08-30 08:40:00 +02:00
committed by GitHub
parent 3b6cdd5f82
commit 7f6c73751f

View File

@@ -90,14 +90,16 @@ if img.remove_media('TOC '):
img.write('Existing.icns', toc=True) img.write('Existing.icns', toc=True)
# print # print
# result type string # return type str
desc = icnsutil.IcnsFile.description(fname, indent=2) desc = icnsutil.IcnsFile.description(fname, indent=2)
print(desc) print(desc)
# verify valid format # verify valid format
# result type objet(list) # return type Iterator[str]
verify = icnsutil.IcnsFile.verify(fname) itr = icnsutil.IcnsFile.verify(fname)
print(list(verify)) print(list(itr))
# If you just want to check if a file is faulty, you can use `any(itr)` instead.
# This way it will not test all checks but break early after the first hit.
``` ```