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
|
return self.text
|
||||||
|
|
||||||
def check(self):
|
def check(self):
|
||||||
from calibre.ebooks.oeb.base import XPNSMAP
|
from calibre.ebooks.oeb.base import XPath
|
||||||
from lxml.etree import XPath
|
|
||||||
try:
|
try:
|
||||||
if self.text.strip():
|
if self.text.strip():
|
||||||
XPath(self.text, namespaces=XPNSMAP)
|
XPath(self.text)
|
||||||
except:
|
except:
|
||||||
import traceback
|
import traceback
|
||||||
traceback.print_exc()
|
traceback.print_exc()
|
||||||
|
Loading…
x
Reference in New Issue
Block a user