Fix more errors when moving to new txtml output.

This commit is contained in:
John Schember 2009-07-12 20:52:03 -04:00
parent 82f3409a59
commit edeedddeb8
3 changed files with 6 additions and 5 deletions

View File

@ -3,6 +3,7 @@
'''
Writer content to palmdoc pdb file.
'''
import os
__license__ = 'GPL v3'
__copyright__ = '2009, John Schember <john@nachtimwald.com>'
@ -46,10 +47,10 @@ class Writer(FormatWriter):
def _generate_text(self, oeb_book):
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...')
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)

View File

@ -51,10 +51,10 @@ class Writer(FormatWriter):
def _generate_text(self, oeb_book):
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...')
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)

View File

@ -37,7 +37,7 @@ class TXTMLizer(object):
self.log = log
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.opts = opts
return self.mlize_spine()