mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-09 03:04:10 -04:00
Fix is set and is not set coloring conditions for test columns
This commit is contained in:
parent
3548babcd9
commit
d38c3a9fd9
@ -128,9 +128,9 @@ class Rule(object): # {{{
|
|||||||
|
|
||||||
def multiple_condition(self, col, action, val, sep):
|
def multiple_condition(self, col, action, val, sep):
|
||||||
if action == 'is set':
|
if action == 'is set':
|
||||||
return "test('%s', '1', '')"%col
|
return "test(field('%s'), '1', '')"%col
|
||||||
if action == 'is not set':
|
if action == 'is not set':
|
||||||
return "test('%s', '', '1')"%col
|
return "test(field('%s'), '', '1')"%col
|
||||||
if action == 'has':
|
if action == 'has':
|
||||||
return "str_in_list(field('%s'), '%s', \"%s\", '1', '')"%(col, sep, val)
|
return "str_in_list(field('%s'), '%s', \"%s\", '1', '')"%(col, sep, val)
|
||||||
if action == 'does not have':
|
if action == 'does not have':
|
||||||
@ -142,9 +142,9 @@ class Rule(object): # {{{
|
|||||||
|
|
||||||
def text_condition(self, col, action, val):
|
def text_condition(self, col, action, val):
|
||||||
if action == 'is set':
|
if action == 'is set':
|
||||||
return "test('%s', '1', '')"%col
|
return "test(field('%s'), '1', '')"%col
|
||||||
if action == 'is not set':
|
if action == 'is not set':
|
||||||
return "test('%s', '', '1')"%col
|
return "test(field('%s'), '', '1')"%col
|
||||||
if action == 'is':
|
if action == 'is':
|
||||||
return "strcmp(field('%s'), \"%s\", '', '1', '')"%(col, val)
|
return "strcmp(field('%s'), \"%s\", '', '1', '')"%(col, val)
|
||||||
if action == 'is not':
|
if action == 'is not':
|
||||||
|
Loading…
x
Reference in New Issue
Block a user