##// END OF EJS Templates
templater: inline unwrapvalue()...
Yuya Nishihara -
r38226:61cecab0 default
parent child Browse files
Show More
@@ -461,7 +461,8 b' def evalfuncarg(context, mapping, arg):'
461 # is fixed. we can't do that right now because join() has to take a generator
461 # is fixed. we can't do that right now because join() has to take a generator
462 # of byte strings as it is, not a lazy byte string.
462 # of byte strings as it is, not a lazy byte string.
463 def _unwrapvalue(context, mapping, thing):
463 def _unwrapvalue(context, mapping, thing):
464 thing = unwrapvalue(context, mapping, thing)
464 if isinstance(thing, wrapped):
465 return thing.tovalue(context, mapping)
465 # evalrawexp() may return string, generator of strings or arbitrary object
466 # evalrawexp() may return string, generator of strings or arbitrary object
466 # such as date tuple, but filter does not want generator.
467 # such as date tuple, but filter does not want generator.
467 return _unthunk(context, mapping, thing)
468 return _unthunk(context, mapping, thing)
@@ -476,7 +477,8 b' def evalboolean(context, mapping, arg):'
476 thing = stringutil.parsebool(data)
477 thing = stringutil.parsebool(data)
477 else:
478 else:
478 thing = func(context, mapping, data)
479 thing = func(context, mapping, data)
479 thing = unwrapvalue(context, mapping, thing)
480 if isinstance(thing, wrapped):
481 thing = thing.tovalue(context, mapping)
480 if isinstance(thing, bool):
482 if isinstance(thing, bool):
481 return thing
483 return thing
482 # other objects are evaluated as strings, which means 0 is True, but
484 # other objects are evaluated as strings, which means 0 is True, but
General Comments 0
You need to be logged in to leave comments. Login now