Mercurial > genshi > mirror
comparison markup/template.py @ 6:71e8e645fe81 trunk
Simplified implementation of `py:content` directive.
author | cmlenz |
---|---|
date | Sun, 04 Jun 2006 10:46:14 +0000 |
parents | dbb08edbc615 |
children | f77f7a91aa46 |
comparison
equal
deleted
inserted
replaced
5:dbb08edbc615 | 6:71e8e645fe81 |
---|---|
240 def __call__(self, stream, ctxt): | 240 def __call__(self, stream, ctxt): |
241 kind, data, pos = stream.next() | 241 kind, data, pos = stream.next() |
242 if kind is Stream.START: | 242 if kind is Stream.START: |
243 yield kind, data, pos # emit start tag | 243 yield kind, data, pos # emit start tag |
244 yield Stream.EXPR, self.expr, pos | 244 yield Stream.EXPR, self.expr, pos |
245 previous = None | 245 previous = stream.next() |
246 try: | 246 for event in stream: |
247 while True: | 247 previous = event |
248 previous = stream.next() | 248 else: |
249 except StopIteration: | |
250 if previous is not None: | 249 if previous is not None: |
251 yield previous | 250 yield previous |
252 | 251 |
253 | 252 |
254 class DefDirective(Directive): | 253 class DefDirective(Directive): |