1
0
mirror of https://github.com/gryf/ebook-converter.git synced 2026-04-27 17:13:32 +02:00

Re added (probably) right formating codes.

This commit is contained in:
2021-06-22 22:06:09 +02:00
parent 546cc26652
commit 84abd62a61
18 changed files with 39 additions and 58 deletions
@@ -112,7 +112,7 @@ class Reader132(FormatReader):
pml = ''
for i in range(1, self.header_record.num_text_pages + 1):
self.log.debug('Extracting text page %s', i)
self.log.debug('Extracting text page %i', i)
pml += self.get_text_page(i)
hizer = PML_HTMLizer()
html += hizer.parse_pml(pml, 'index.html')
@@ -123,7 +123,7 @@ class Reader132(FormatReader):
footnoteids = re.findall(
'\\w+(?=\x00)', self.section_data(self.header_record.footnote_offset).decode('cp1252' if self.encoding is None else self.encoding))
for fid, i in enumerate(range(self.header_record.footnote_offset + 1, self.header_record.footnote_offset + self.header_record.footnote_count)):
self.log.debug('Extracting footnote page %s', i)
self.log.debug('Extracting footnote page %i', i)
if fid < len(footnoteids):
fid = footnoteids[fid]
else:
@@ -135,7 +135,7 @@ class Reader132(FormatReader):
sidebarids = re.findall(
'\\w+(?=\x00)', self.section_data(self.header_record.sidebar_offset).decode('cp1252' if self.encoding is None else self.encoding))
for sid, i in enumerate(range(self.header_record.sidebar_offset + 1, self.header_record.sidebar_offset + self.header_record.sidebar_count)):
self.log.debug('Extracting sidebar page %s', i)
self.log.debug('Extracting sidebar page %i', i)
if sid < len(sidebarids):
sid = sidebarids[sid]
else:
@@ -87,7 +87,7 @@ class Reader202(FormatReader):
pml = ''
for i in range(1, self.header_record.num_text_pages + 1):
self.log.debug('Extracting text page %s', i)
self.log.debug('Extracting text page %i', i)
pml += self.get_text_page(i)
title = self.mi.title
+1 -1
View File
@@ -118,7 +118,7 @@ class Reader(FormatReader):
self.log.info('Decompressing text...')
for i in range(1, self.header_record.num_records + 1):
self.log.debug('\tDecompressing text section %s', i)
self.log.debug('\tDecompressing text section %i', i)
title = self.header_record.chapter_titles[i-1]
lines = []
title_added = False
+1 -1
View File
@@ -55,7 +55,7 @@ class Reader(FormatReader):
self.log.info('Decompressing text...')
for i in range(1, self.header_record.num_records + 1):
self.log.debug('\tDecompressing text section %s', i)
self.log.debug('\tDecompressing text section %i', i)
raw_txt += self.decompress_text(i)
self.log.info('Converting text to OEB...')
+2 -2
View File
@@ -54,7 +54,7 @@ class Reader(FormatReader):
if (self.header_record.flags & 0x01) == 0:
raise zTXTError('Only compression method 1 (random access) is supported')
self.log.debug('Foud ztxt version: %s.%s', vmajor, vminor)
self.log.debug('Foud ztxt version: %i.%i', vmajor, vminor)
# Initalize the decompressor
self.uncompressor = zlib.decompressobj()
@@ -73,7 +73,7 @@ class Reader(FormatReader):
self.log.info('Decompressing text...')
for i in range(1, self.header_record.num_records + 1):
self.log.debug('\tDecompressing text section %s', i)
self.log.debug('\tDecompressing text section %i', i)
raw_txt += self.decompress_text(i)
self.log.info('Converting text to OEB...')