Regex Builder: Show correct input step

This commit is contained in:
Kovid Goyal 2009-10-16 18:05:58 -06:00
parent ba7e499862
commit bcb0f1e271
2 changed files with 3 additions and 3 deletions

View File

@ -122,7 +122,7 @@ class EbookIterator(object):
else: else:
print 'Loaded embedded font:', repr(family) print 'Loaded embedded font:', repr(family)
def __enter__(self): def __enter__(self, raw_only=False):
self.delete_on_exit = [] self.delete_on_exit = []
self._tdir = TemporaryDirectory('_ebook_iter') self._tdir = TemporaryDirectory('_ebook_iter')
self.base = self._tdir.__enter__() self.base = self._tdir.__enter__()
@ -139,7 +139,7 @@ class EbookIterator(object):
plumber.opts, plumber.input_fmt, self.log, plumber.opts, plumber.input_fmt, self.log,
{}, self.base) {}, self.base)
if plumber.input_fmt.lower() in ('pdf', 'rb'): if not raw_only and plumber.input_fmt.lower() in ('pdf', 'rb'):
self.pathtoopf = create_oebbook(self.log, self.pathtoopf, plumber.opts, self.pathtoopf = create_oebbook(self.log, self.pathtoopf, plumber.opts,
plumber.input_plugin) plumber.input_plugin)
if hasattr(self.pathtoopf, 'manifest'): if hasattr(self.pathtoopf, 'manifest'):

View File

@ -87,7 +87,7 @@ class RegexBuilder(QDialog, Ui_RegexBuilder):
def open_book(self, pathtoebook): def open_book(self, pathtoebook):
self.iterator = EbookIterator(pathtoebook) self.iterator = EbookIterator(pathtoebook)
self.iterator.__enter__() self.iterator.__enter__(raw_only=True)
text = [u''] text = [u'']
for path in self.iterator.spine: for path in self.iterator.spine:
html = open(path, 'rb').read().decode(path.encoding, 'replace') html = open(path, 'rb').read().decode(path.encoding, 'replace')