mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-09 03:04:10 -04:00
Regex Builder: Show correct input step
This commit is contained in:
parent
ba7e499862
commit
bcb0f1e271
@ -122,7 +122,7 @@ class EbookIterator(object):
|
||||
else:
|
||||
print 'Loaded embedded font:', repr(family)
|
||||
|
||||
def __enter__(self):
|
||||
def __enter__(self, raw_only=False):
|
||||
self.delete_on_exit = []
|
||||
self._tdir = TemporaryDirectory('_ebook_iter')
|
||||
self.base = self._tdir.__enter__()
|
||||
@ -139,7 +139,7 @@ class EbookIterator(object):
|
||||
plumber.opts, plumber.input_fmt, self.log,
|
||||
{}, 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,
|
||||
plumber.input_plugin)
|
||||
if hasattr(self.pathtoopf, 'manifest'):
|
||||
|
@ -87,7 +87,7 @@ class RegexBuilder(QDialog, Ui_RegexBuilder):
|
||||
|
||||
def open_book(self, pathtoebook):
|
||||
self.iterator = EbookIterator(pathtoebook)
|
||||
self.iterator.__enter__()
|
||||
self.iterator.__enter__(raw_only=True)
|
||||
text = [u'']
|
||||
for path in self.iterator.spine:
|
||||
html = open(path, 'rb').read().decode(path.encoding, 'replace')
|
||||
|
Loading…
x
Reference in New Issue
Block a user