mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-09 03:04:10 -04:00
Fix the NOT function.
This commit is contained in:
parent
da9aef6c58
commit
87c178accb
@ -727,13 +727,8 @@ class BuiltinNot(BuiltinFormatterFunction):
|
||||
'returns the empty string. This function works well with test or '
|
||||
'first_non_empty. You can have as many values as you want.')
|
||||
|
||||
def evaluate(self, formatter, kwargs, mi, locals, *args):
|
||||
i = 0
|
||||
while i < len(args):
|
||||
if args[i]:
|
||||
return '1'
|
||||
i += 1
|
||||
return ''
|
||||
def evaluate(self, formatter, kwargs, mi, locals, val):
|
||||
return '' if val else '1'
|
||||
|
||||
class BuiltinMergeLists(BuiltinFormatterFunction):
|
||||
name = 'merge_lists'
|
||||
|
Loading…
x
Reference in New Issue
Block a user