This commit is contained in:
Kovid Goyal 2011-08-03 23:34:22 -06:00
parent 7471f00b04
commit 56ed853122
2 changed files with 7 additions and 5 deletions

View File

@ -766,6 +766,7 @@ class IndexEntry(object): # {{{
flags = self.flags
for tag in expected_tags:
vals = []
if tag.tag > 64:
has_tag = flags & 0b1
flags = flags >> 1
@ -781,8 +782,8 @@ class IndexEntry(object): # {{{
self.consumed = len(orig_raw) - len(raw)
self.trailing_bytes = raw
if self.trailing_bytes.replace(b'\0', b''):
raise ValueError('IndexEntry has leftover bytes: %s'%format_bytes(
self.trailing_bytes))
raise ValueError('%s has leftover bytes: %s'%(self, format_bytes(
self.trailing_bytes)))
@property
def label(self):

View File

@ -97,7 +97,8 @@ class TAGX(object): # {{{
'''
TAGX block for the Primary index header of a periodical
'''
map(self.add_tag, (1, 2, 3, 4, 5, 21, 22, 23, 0, 69, 70, 71, 72, 73, 0))
list(map(self.add_tag, (1, 2, 3, 4, 5, 21, 22, 23, 0, 69, 70, 71, 72,
73, 0)))
return self.header(2) + bytes(self.byts)
@property
@ -105,7 +106,7 @@ class TAGX(object): # {{{
'''
TAGX block for the secondary index header of a periodical
'''
map(self.add_tag, (11, 0))
list(map(self.add_tag, (11, 0)))
return self.header(1) + bytes(self.byts)
@property
@ -113,7 +114,7 @@ class TAGX(object): # {{{
'''
TAGX block for the primary index header of a flat book
'''
map(self.add_tag, (1, 2, 3, 4, 0))
list(map(self.add_tag, (1, 2, 3, 4, 0)))
return self.header(1) + bytes(self.byts)
# }}}