Mercurial > genshi > genshi-test
changeset 562:21f3c4bdd964
In the py:choose stack, store the information of whether a test expression has been supplied separate from the result of its evaluation.
author | cmlenz |
---|---|
date | Thu, 05 Jul 2007 17:49:20 +0000 |
parents | 3225bb74c672 |
children | 80fb59bd2342 |
files | genshi/template/directives.py |
diffstat | 1 files changed, 3 insertions(+), 3 deletions(-) [+] |
line wrap: on
line diff
--- a/genshi/template/directives.py +++ b/genshi/template/directives.py @@ -587,9 +587,9 @@ attach = classmethod(attach) def __call__(self, stream, ctxt, directives): - info = [False, None] + info = [False, bool(self.expr), None] if self.expr: - info[1] = self.expr.evaluate(ctxt) + info[2] = self.expr.evaluate(ctxt) ctxt._choice_stack.append(info) for event in _apply_directives(stream, ctxt, directives): yield event @@ -628,7 +628,7 @@ 'must have a test expression', self.filename, *stream.next()[2][1:]) if info[1]: - value = info[1] + value = info[2] if self.expr: matched = value == self.expr.evaluate(ctxt) else: