barneygale / isoparser

Parser for the ISO 9660 disk image format
Other
29 stars 22 forks source link

Support for with statement and real bools for record flags. #6

Closed JeanOlivier closed 8 years ago

JeanOlivier commented 8 years ago

Added support to open isos using the with statement and made records flags into proper bools.

barneygale commented 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.

JeanOlivier commented 8 years ago

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.

barneygale commented 8 years ago

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.

JeanOlivier commented 8 years ago

No problem. Your implementation makes sense. I opened another PR (#7) as I don't know how to edit this one.