Closed JeanOlivier closed 8 years ago
I've pushed context manager support to the develop
branch - 9a75051d. Can you take a look? The implementation is a little different.
Tested it with both local and online isos and it seems to work fine for me.
I'd have (naively) used file.__exit__
instead of file.close
, but I guess the latter makes more sense as the file was opened with file.open
rather than file.__enter__
.
Do you plan to accept the bool part? I did it only because it was weird to be told 2
when checking is_directory
on a directory record interactively.
Thanks for considering my PRs.
Yep happy to accept that, could you rebase against develop
and remove the other commits? Apologies for being one of those pricks who sees a pull req and reimplements it themselves - I just wanted the implementation to be a little more generic in case we add other kinds of sources in future.
No problem. Your implementation makes sense. I opened another PR (#7) as I don't know how to edit this one.
Added support to open isos using the with statement and made records flags into proper bools.