This commit is contained in:
jevans 2013-06-17 20:36:22 -04:00
commit 1404be4bf1
3 changed files with 8 additions and 8 deletions

View file

@ -226,7 +226,7 @@ class Codestream:
def __str__(self): def __str__(self):
msg = 'Codestream:\n' msg = 'Codestream:\n'
for segment in self.segment: for segment in self.segment:
strs = segment.__str__() strs = str(segment)
# Add indentation # Add indentation
strs = [(' ' + x + '\n') for x in strs.split('\n')] strs = [(' ' + x + '\n') for x in strs.split('\n')]

View file

@ -532,7 +532,7 @@ class ContiguousCodestreamBox(Jp2kBox):
msg = Jp2kBox.__str__(self) msg = Jp2kBox.__str__(self)
msg += '\n Main header:' msg += '\n Main header:'
for segment in self.main_header.segment: for segment in self.main_header.segment:
segstr = segment.__str__() segstr = str(segment)
# Add indentation. # Add indentation.
strs = [('\n ' + x) for x in segstr.split('\n')] strs = [('\n ' + x) for x in segstr.split('\n')]
@ -760,7 +760,7 @@ class AssociationBox(Jp2kBox):
def __str__(self): def __str__(self):
msg = Jp2kBox.__str__(self) msg = Jp2kBox.__str__(self)
for box in self.box: for box in self.box:
boxstr = box.__str__() boxstr = str(box)
# Add indentation. # Add indentation.
strs = [('\n ' + x) for x in boxstr.split('\n')] strs = [('\n ' + x) for x in boxstr.split('\n')]
@ -824,7 +824,7 @@ class JP2HeaderBox(Jp2kBox):
def __str__(self): def __str__(self):
msg = Jp2kBox.__str__(self) msg = Jp2kBox.__str__(self)
for box in self.box: for box in self.box:
boxstr = box.__str__() boxstr = str(box)
# Add indentation. # Add indentation.
strs = [('\n ' + x) for x in boxstr.split('\n')] strs = [('\n ' + x) for x in boxstr.split('\n')]
@ -1177,7 +1177,7 @@ class ResolutionBox(Jp2kBox):
def __str__(self): def __str__(self):
msg = Jp2kBox.__str__(self) msg = Jp2kBox.__str__(self)
for box in self.box: for box in self.box:
boxstr = box.__str__() boxstr = str(box)
# Add indentation. # Add indentation.
strs = [('\n ' + x) for x in boxstr.split('\n')] strs = [('\n ' + x) for x in boxstr.split('\n')]
@ -1554,7 +1554,7 @@ class UUIDInfoBox(Jp2kBox):
msg = Jp2kBox.__str__(self) msg = Jp2kBox.__str__(self)
for box in self.box: for box in self.box:
box_str = box.__str__() box_str = str(box)
# Add indentation. # Add indentation.
lst = [('\n ' + x) for x in box_str.split('\n')] lst = [('\n ' + x) for x in box_str.split('\n')]

View file

@ -87,10 +87,10 @@ class Jp2k(Jp2kBox):
metadata = ['File: ' + os.path.basename(self.filename)] metadata = ['File: ' + os.path.basename(self.filename)]
if len(self.box) > 0: if len(self.box) > 0:
for box in self.box: for box in self.box:
metadata.append(box.__str__()) metadata.append(str(box))
else: else:
c = self.get_codestream() c = self.get_codestream()
metadata.append(c.__str__()) metadata.append(str(c))
return '\n'.join(metadata) return '\n'.join(metadata)
def _parse(self): def _parse(self):