Meh, too bad, but predictable.
For information, here is my code for the strcase function (more consistent with Calibre standards)
strcase(x, y, lt, eq, gt)
Code:
def evaluate(self, formatter, kwargs, mi, locals, x, y, lt, eq, gt):
from calibre.utils.icu import case_sensitive_strcmp as strcmp
v = strcmp(x, y)
if v < 0:
return lt
if v == 0:
return eq
return gt
Quote:
strcase(x, y, lt, eq, gt) -- does a case-sensitive comparison of x and y as strings. Returns lt if x < y. Returns eq if x == y. Otherwise returns gt.
|
Note, I'm thinking if
I commit this to Calibre. Literals operator are unnecessary for a such marginal case, but providing a build-in function would be useful, so you don't have to look up how to do it if you ever need it.