comparison genshi/template/inline.py @ 902:09cc3627654c experimental-inline

Sync `experimental/inline` branch with [source:trunk@1126].
author cmlenz
date Fri, 23 Apr 2010 21:08:26 +0000
parents eb8aa8690480
children 95d62e239f60
comparison
equal deleted inserted replaced
830:de82830f8816 902:09cc3627654c
179 for line in _apply(rest, stream): 179 for line in _apply(rest, stream):
180 yield line 180 yield line
181 w.unshift() 181 w.unshift()
182 182
183 else: 183 else:
184 raise NotImplementedError 184 raise NotImplementedError, '%r not supported' % d.tagname
185 185
186 yield w() 186 yield w()
187 187
188 # Generate code for the given template stream 188 # Generate code for the given template stream
189 def _generate(stream): 189 def _generate(stream):
285 <?python 285 <?python
286 def foo(x): 286 def foo(x):
287 return x*x 287 return x*x
288 ?> 288 ?>
289 <body> 289 <body>
290 <h1 py:def="sayhi(name='world')" py:strip=""> 290 <h1 py:def="sayhi(name='world')">
291 Hello, $name! 291 Hello, $name!
292 </h1> 292 </h1>
293 ${sayhi()} 293 ${sayhi()}
294 <ul py:if="items"> 294 <ul py:if="items">
295 <li py:for="idx, item in enumerate(items)" 295 <li py:for="idx, item in enumerate(items)"
Copyright (C) 2012-2017 Edgewall Software