Fixed doctest for wrap.

This commit is contained in:
John Evans 2013-06-27 16:34:39 -04:00
commit 2d22c9e012

View file

@ -430,7 +430,7 @@ class Jp2k(Jp2kBox):
>>> jfile = glymur.data.goodstuff() >>> jfile = glymur.data.goodstuff()
>>> j2k = glymur.Jp2k(jfile) >>> j2k = glymur.Jp2k(jfile)
>>> tfile = tempfile.NamedTemporaryFile(suffix='jp2') >>> tfile = tempfile.NamedTemporaryFile(suffix='jp2')
>>> j2k.wrap(tfile.name) >>> jp2 = j2k.wrap(tfile.name)
""" """
if boxes is None: if boxes is None:
# Try to create a reasonable default. # Try to create a reasonable default.
@ -501,7 +501,8 @@ class Jp2k(Jp2kBox):
typ = cdef.channel_type typ = cdef.channel_type
index = cdef.index index = cdef.index
if colr.colorspace == SRGB: if colr.colorspace == SRGB:
if any([chan + 1 not in assn or typ[chan] != 0 for chan in [0, 1, 2]]): if any([chan + 1 not in assn or typ[chan] != 0
for chan in [0, 1, 2]]):
msg = "All color channels must be defined in the " msg = "All color channels must be defined in the "
msg += "channel definition box." msg += "channel definition box."
raise IOError(msg) raise IOError(msg)
@ -543,7 +544,6 @@ class Jp2k(Jp2kBox):
jp2 = Jp2k(filename) jp2 = Jp2k(filename)
return jp2 return jp2
def read(self, reduce=0, layer=0, area=None, tile=None, verbose=False): def read(self, reduce=0, layer=0, area=None, tile=None, verbose=False):
"""Read a JPEG 2000 image. """Read a JPEG 2000 image.