From 07d1ca7ec3669ecaa2d202819be3659c5dada94b Mon Sep 17 00:00:00 2001 From: Kovid Goyal Date: Thu, 24 Feb 2011 10:38:26 -0700 Subject: [PATCH] ... --- src/calibre/ebooks/mobi/writer.py | 26 +++++++++++++------------- 1 file changed, 13 insertions(+), 13 deletions(-) diff --git a/src/calibre/ebooks/mobi/writer.py b/src/calibre/ebooks/mobi/writer.py index 0c33dffef2..2be699e525 100644 --- a/src/calibre/ebooks/mobi/writer.py +++ b/src/calibre/ebooks/mobi/writer.py @@ -2256,22 +2256,22 @@ class MobiWriter(object): return sectionIndices, sectionParents def _generate_section_article_indices(self, i, section, entries, sectionIndices, sectionParents): - sectionArticles = list(section.iter())[1:] - # Iterate over the section's articles + sectionArticles = list(section.iter())[1:] + # Iterate over the section's articles - for (j, article) in enumerate(sectionArticles): - # Recompute offset and length for each article - offset, length = self._compute_offset_length(i, article, entries) - if self.opts.verbose > 2 : - self._oeb.logger.info( "article %02d: offset = 0x%06X length = 0x%06X" % (j, offset, length) ) + for (j, article) in enumerate(sectionArticles): + # Recompute offset and length for each article + offset, length = self._compute_offset_length(i, article, entries) + if self.opts.verbose > 2 : + self._oeb.logger.info( "article %02d: offset = 0x%06X length = 0x%06X" % (j, offset, length) ) - ctoc_map_index = i + j + 1 + ctoc_map_index = i + j + 1 - #hasAuthor = self._ctoc_map[ctoc_map_index].get('authorOffset') - #hasDescription = self._ctoc_map[ctoc_map_index].get('descriptionOffset') - mySectionParent = sectionParents[sectionIndices[i-1]] - myNewArticle = MobiArticle(mySectionParent, offset, length, ctoc_map_index ) - mySectionParent.addArticle( myNewArticle ) + #hasAuthor = self._ctoc_map[ctoc_map_index].get('authorOffset') + #hasDescription = self._ctoc_map[ctoc_map_index].get('descriptionOffset') + mySectionParent = sectionParents[sectionIndices[i-1]] + myNewArticle = MobiArticle(mySectionParent, offset, length, ctoc_map_index ) + mySectionParent.addArticle( myNewArticle ) def _add_book_chapters(self, myDoc, indxt, indices): chapterCount = myDoc.documentStructure.chapterCount()