mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-09 03:04:10 -04:00
Make the inlist_field operator work on identifiers so it has the same result as inlist
This commit is contained in:
parent
a4c4a8fa33
commit
a2b38bd882
@ -1403,9 +1403,14 @@ class _Interpreter:
|
|||||||
if res is None or not isinstance(res, (list, tuple, set, dict)):
|
if res is None or not isinstance(res, (list, tuple, set, dict)):
|
||||||
self.error(_("Field '{0}' is either not a field or not a list").format(right), prog.line_number)
|
self.error(_("Field '{0}' is either not a field or not a list").format(right), prog.line_number)
|
||||||
pat = re.compile(left, flags=re.I)
|
pat = re.compile(left, flags=re.I)
|
||||||
for v in res:
|
if isinstance(res, dict): # identifiers
|
||||||
if re.search(pat, v):
|
for k,v in res.items():
|
||||||
return '1'
|
if re.search(pat, f'{k}:{v}'):
|
||||||
|
return '1'
|
||||||
|
else:
|
||||||
|
for v in res:
|
||||||
|
if re.search(pat, v):
|
||||||
|
return '1'
|
||||||
return ''
|
return ''
|
||||||
|
|
||||||
def do_node_string_infix(self, prog):
|
def do_node_string_infix(self, prog):
|
||||||
|
Loading…
x
Reference in New Issue
Block a user