From 3635ee19e29ae5dbec35e752b222e395ba31e018 Mon Sep 17 00:00:00 2001 From: Kovid Goyal Date: Sun, 31 Jul 2011 00:38:57 -0600 Subject: [PATCH] ... --- src/calibre/ebooks/mobi/debug.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/calibre/ebooks/mobi/debug.py b/src/calibre/ebooks/mobi/debug.py index b51938e60b..91a203fa2b 100644 --- a/src/calibre/ebooks/mobi/debug.py +++ b/src/calibre/ebooks/mobi/debug.py @@ -509,7 +509,7 @@ class SecondaryIndexHeader(object): # {{{ a('Control byte count: %d'%self.tagx_control_byte_count) for i in self.tagx_entries: a('\t' + repr(i)) - a('Text of last entry in NCX: %s'% self.last_entry) + a('Index of last IndexEntry in secondary index record: %s'% self.last_entry) a('Number of entries in the NCX: %d'% self.ncx_count) return '\n'.join(ans) @@ -570,6 +570,7 @@ class IndexHeader(object): # {{{ last_num, consumed = decode_hex_number(raw[idxt0_pos:]) count_pos = idxt0_pos + consumed self.ncx_count, = struct.unpack(b'>H', raw[count_pos:count_pos+2]) + self.last_entry = last_num if last_num != self.ncx_count - 1: raise ValueError('Last id number in the NCX != NCX count - 1') @@ -615,6 +616,7 @@ class IndexHeader(object): # {{{ a('Control byte count: %d'%self.tagx_control_byte_count) for i in self.tagx_entries: a('\t' + repr(i)) + a('Index of last IndexEntry in primary index record: %s'% self.last_entry) a('Number of entries in the NCX: %d'% self.ncx_count) return '\n'.join(ans)