mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-09 03:04:10 -04:00
Fix #801791 (Search RegExp Wizard fails on all LIT files in 0.8.7)
This commit is contained in:
parent
f92aa96a4e
commit
7641b92166
@ -139,7 +139,10 @@ class RegexBuilder(QDialog, Ui_RegexBuilder):
|
|||||||
try:
|
try:
|
||||||
self.open_book(fpath)
|
self.open_book(fpath)
|
||||||
finally:
|
finally:
|
||||||
|
try:
|
||||||
os.remove(fpath)
|
os.remove(fpath)
|
||||||
|
except:
|
||||||
|
pass
|
||||||
return True
|
return True
|
||||||
|
|
||||||
def open_book(self, pathtoebook):
|
def open_book(self, pathtoebook):
|
||||||
@ -148,7 +151,8 @@ class RegexBuilder(QDialog, Ui_RegexBuilder):
|
|||||||
text = [u'']
|
text = [u'']
|
||||||
preprocessor = HTMLPreProcessor(None, False)
|
preprocessor = HTMLPreProcessor(None, False)
|
||||||
for path in self.iterator.spine:
|
for path in self.iterator.spine:
|
||||||
html = open(path, 'rb').read().decode('utf-8', 'replace')
|
with open(path, 'rb') as f:
|
||||||
|
html = f.read().decode('utf-8', 'replace')
|
||||||
html = preprocessor(html, get_preprocess_html=True)
|
html = preprocessor(html, get_preprocess_html=True)
|
||||||
text.append(html)
|
text.append(html)
|
||||||
self.preview.setPlainText('\n---\n'.join(text))
|
self.preview.setPlainText('\n---\n'.join(text))
|
||||||
|
Loading…
x
Reference in New Issue
Block a user