diff --git a/src/calibre/ebooks/pdb/palmdoc/reader.py b/src/calibre/ebooks/pdb/palmdoc/reader.py index f1f00ea8e3..dd9706f00c 100644 --- a/src/calibre/ebooks/pdb/palmdoc/reader.py +++ b/src/calibre/ebooks/pdb/palmdoc/reader.py @@ -62,7 +62,13 @@ class Reader(FormatReader): self.log.info('Converting text to OEB...') stream = StringIO(raw_txt) + from calibre.customize.ui import plugin_for_input_format + + txt_plugin = plugin_for_input_format('txt') + for option in txt_plugin.options: + if not hasattr(self.options, option.option.name): + setattr(self.options, option.name, option.recommend_val) + stream.seek(0) - return plugin_for_input_format('txt').convert(stream, self.options, - 'txt', self.log, {}) + return txt_plugin.convert(stream, self.options, 'txt', self.log, {}) diff --git a/src/calibre/ebooks/pdb/ztxt/reader.py b/src/calibre/ebooks/pdb/ztxt/reader.py index 7e51dae1fd..8d51c07e97 100644 --- a/src/calibre/ebooks/pdb/ztxt/reader.py +++ b/src/calibre/ebooks/pdb/ztxt/reader.py @@ -79,7 +79,13 @@ class Reader(FormatReader): self.log.info('Converting text to OEB...') stream = StringIO(raw_txt) + from calibre.customize.ui import plugin_for_input_format + + txt_plugin = plugin_for_input_format('txt') + for option in txt_plugin.options: + if not hasattr(self.options, option.option.name): + setattr(self.options, option.name, option.recommend_val) + stream.seek(0) - return plugin_for_input_format('txt').convert(stream, self.options, - 'txt', self.log, {}) + return txt_plugin.convert(stream, self.options, 'txt', self.log, {}) diff --git a/src/calibre/ebooks/tcr/input.py b/src/calibre/ebooks/tcr/input.py index 47fe7e7337..5f9554665b 100644 --- a/src/calibre/ebooks/tcr/input.py +++ b/src/calibre/ebooks/tcr/input.py @@ -41,7 +41,14 @@ class TCRInput(InputFormatPlugin): log.info('Converting text to OEB...') stream = StringIO(raw_txt) + from calibre.customize.ui import plugin_for_input_format + + txt_plugin = plugin_for_input_format('txt') + for option in txt_plugin.options: + if not hasattr(options, option.option.name): + setattr(options, option.name, option.recommend_val) + stream.seek(0) - return plugin_for_input_format('txt').convert(stream, options, + return txt_plugin.convert(stream, options, 'txt', log, accelerators)