mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-09 03:04:10 -04:00
DRYer
This commit is contained in:
parent
9de4b76699
commit
8d4966f14b
@ -94,11 +94,10 @@ class XPathEdit(QWidget, Ui_Edit):
|
||||
return self.text
|
||||
|
||||
def check(self):
|
||||
from calibre.ebooks.oeb.base import XPNSMAP
|
||||
from lxml.etree import XPath
|
||||
from calibre.ebooks.oeb.base import XPath
|
||||
try:
|
||||
if self.text.strip():
|
||||
XPath(self.text, namespaces=XPNSMAP)
|
||||
XPath(self.text)
|
||||
except:
|
||||
import traceback
|
||||
traceback.print_exc()
|
||||
|
Loading…
x
Reference in New Issue
Block a user