openpreserve / jpylyzer

JP2 (JPEG 2000 Part 1) validator and properties extractor. Jpylyzer was specifically created to check that a JP2 file really conforms to the format's specifications. Additionally jpylyzer is able to extract technical characteristics.
http://jpylyzer.openpreservation.org/
Other
69 stars 28 forks source link

Pep8/ Doctest #33

Closed WillemJan closed 9 years ago

WillemJan commented 11 years ago

PEP8: changes, makes code readable (A Foolish Consistency is the Hobgoblin of Little Minds).

Doctest: balloon.jp2 is now tested, the rest of the examples should also be doc-tested.

bitsgalore commented 11 years ago

Thanks for these additions. Two comments.

First, the pretty-printing option can result in empty output in some special cased where e.g. codestream comments or embedded XML contain weird characters, which don't seem to be handled well by minidom. For an example, go here:

https://github.com/openplanets/jpylyzer-test-files

And run the modified code on this image:

invalid_character_in_codestream_comment.jp2

I remember running into similar problems while testing some very early versions of jpylyzer (which actually did have pretty-printing). In the end I simply gave up on it and removed pretty printing altogether. But perhaps it's possible to make it work somewhow?

Second, running the test script jpylyzer_test.py script under Window$ 7 gives me:

TypeError: checkFiles() got an unexpected keyword argument 'test'

Things do work when I remove 'test=True', but in that case I still get this:

********************************************************************** 1 items had failures: 1 of 3 in __main__.test_balloon_jp3 ***Test Failed*** 1 failures.

But I'm not really sure what's supposed to come out of it in the first place?