Since the documentation lists zipfile as inspiration, to be more in line with the ZipFile built-in class, I suggest that the __enter__ and __exit__ methods be implemented.
While working with this library, I tried the following:
if file.endswith(".cbz"):
with ZipFile("{}/temp/{}".format(project_root, file)) as zipped:
...
if file.endswith(".cbr"):
with RarFile("{}/temp/{}".format(project_root, file)) as rarred:
...
only to find that the __enter__ and __exit__ methods weren't implemented.
I borrowed from the ZipFile class methods, but it's worth noting that the file is not left open in __init__ so it should not be closed in __exit__ as it is in the ZipFile class.
Since the documentation lists
zipfile
as inspiration, to be more in line with theZipFile
built-in class, I suggest that the__enter__
and__exit__
methods be implemented.While working with this library, I tried the following:
only to find that the
__enter__
and__exit__
methods weren't implemented.I borrowed from the
ZipFile
class methods, but it's worth noting that the file is not left open in__init__
so it should not be closed in__exit__
as it is in theZipFile
class.