mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-09 03:04:10 -04:00
Fix more errors when moving to new txtml output.
This commit is contained in:
parent
82f3409a59
commit
edeedddeb8
@ -3,6 +3,7 @@
|
|||||||
'''
|
'''
|
||||||
Writer content to palmdoc pdb file.
|
Writer content to palmdoc pdb file.
|
||||||
'''
|
'''
|
||||||
|
import os
|
||||||
|
|
||||||
__license__ = 'GPL v3'
|
__license__ = 'GPL v3'
|
||||||
__copyright__ = '2009, John Schember <john@nachtimwald.com>'
|
__copyright__ = '2009, John Schember <john@nachtimwald.com>'
|
||||||
@ -46,10 +47,10 @@ class Writer(FormatWriter):
|
|||||||
|
|
||||||
def _generate_text(self, oeb_book):
|
def _generate_text(self, oeb_book):
|
||||||
writer = TXTMLizer(self.log)
|
writer = TXTMLizer(self.log)
|
||||||
txt = writer.extract_content(oeb_book, opts)
|
txt = writer.extract_content(oeb_book, self.opts)
|
||||||
|
|
||||||
self.log.debug('\tReplacing newlines with selected type...')
|
self.log.debug('\tReplacing newlines with selected type...')
|
||||||
txt = specified_newlines(TxtNewlines(opts.newline).newline, txt).encode(self.opts.output_encoding, 'replace')
|
txt = specified_newlines(TxtNewlines('windows').newline, txt).encode(self.opts.output_encoding, 'replace')
|
||||||
|
|
||||||
txt_length = len(txt)
|
txt_length = len(txt)
|
||||||
|
|
||||||
|
@ -51,10 +51,10 @@ class Writer(FormatWriter):
|
|||||||
|
|
||||||
def _generate_text(self, oeb_book):
|
def _generate_text(self, oeb_book):
|
||||||
writer = TXTMLizer(self.log)
|
writer = TXTMLizer(self.log)
|
||||||
txt = writer.extract_content(oeb_book, opts)
|
txt = writer.extract_content(oeb_book, self.opts)
|
||||||
|
|
||||||
self.log.debug('\tReplacing newlines with selected type...')
|
self.log.debug('\tReplacing newlines with selected type...')
|
||||||
txt = specified_newlines(TxtNewlines(opts.newline).newline, txt).encode(self.opts.output_encoding, 'replace')
|
txt = specified_newlines(TxtNewlines('windows').newline, txt).encode(self.opts.output_encoding, 'replace')
|
||||||
|
|
||||||
txt_length = len(txt)
|
txt_length = len(txt)
|
||||||
|
|
||||||
|
@ -37,7 +37,7 @@ class TXTMLizer(object):
|
|||||||
self.log = log
|
self.log = log
|
||||||
|
|
||||||
def extract_content(self, oeb_book, opts):
|
def extract_content(self, oeb_book, opts):
|
||||||
self.log.info('Converting XHTML to PML markup...')
|
self.log.info('Converting XHTML to TXT...')
|
||||||
self.oeb_book = oeb_book
|
self.oeb_book = oeb_book
|
||||||
self.opts = opts
|
self.opts = opts
|
||||||
return self.mlize_spine()
|
return self.mlize_spine()
|
||||||
|
Loading…
x
Reference in New Issue
Block a user