mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-08 18:54:09 -04:00
...
This commit is contained in:
parent
f3fb205d58
commit
11b541083c
@ -114,7 +114,9 @@ class DetectStructure(object):
|
|||||||
|
|
||||||
def find_matches(expr, doc):
|
def find_matches(expr, doc):
|
||||||
try:
|
try:
|
||||||
return XPath(expr)(doc)
|
ans = XPath(expr)(doc)
|
||||||
|
len(ans)
|
||||||
|
return ans
|
||||||
except:
|
except:
|
||||||
self.log.warn('Invalid chapter expression, ignoring: %s'%expr)
|
self.log.warn('Invalid chapter expression, ignoring: %s'%expr)
|
||||||
return []
|
return []
|
||||||
@ -203,7 +205,9 @@ class DetectStructure(object):
|
|||||||
|
|
||||||
def find_matches(expr, doc):
|
def find_matches(expr, doc):
|
||||||
try:
|
try:
|
||||||
return XPath(expr)(doc)
|
ans = XPath(expr)(doc)
|
||||||
|
len(ans)
|
||||||
|
return ans
|
||||||
except:
|
except:
|
||||||
self.log.warn('Invalid ToC expression, ignoring: %s'%expr)
|
self.log.warn('Invalid ToC expression, ignoring: %s'%expr)
|
||||||
return []
|
return []
|
||||||
|
Loading…
x
Reference in New Issue
Block a user