mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-08 10:44:09 -04:00
Fix use of _ as local variable and gettext in same scope
This commit is contained in:
parent
b7795f989e
commit
fd207da67c
@ -822,11 +822,11 @@ class BuiltinIdentifierInList(BuiltinFormatterFunction):
|
|||||||
raise ValueError(_("{} requires 2 or 4 arguments").format(self.name))
|
raise ValueError(_("{} requires 2 or 4 arguments").format(self.name))
|
||||||
|
|
||||||
l = [v.strip() for v in val.split(',') if v.strip()]
|
l = [v.strip() for v in val.split(',') if v.strip()]
|
||||||
(id_, _, regexp) = ident.partition(':')
|
(id_, __, regexp) = ident.partition(':')
|
||||||
if not id_:
|
if not id_:
|
||||||
return nfv
|
return nfv
|
||||||
for candidate in l:
|
for candidate in l:
|
||||||
i, _, v = candidate.partition(':')
|
i, __, v = candidate.partition(':')
|
||||||
if v and i == id_:
|
if v and i == id_:
|
||||||
if not regexp or re.search(regexp, v, flags=re.I):
|
if not regexp or re.search(regexp, v, flags=re.I):
|
||||||
return candidate if fv_is_id else fv
|
return candidate if fv_is_id else fv
|
||||||
|
Loading…
x
Reference in New Issue
Block a user