purcell / airspeed

A lightweight Python template engine compatible with Velocity, used in OpenStack
Other
91 stars 37 forks source link

#define - Assigns a block of VTL to a reference #14

Open jmdcal opened 9 years ago

jmdcal commented 9 years ago
import airspeed
d = """
#define( $hello ) Hello $who #end 
#set( $who = "World!") $hello 
"""
t = airspeed.Template(d)
o = t.merge({   })
print o

http://velocity.apache.org/engine/devel/vtl-reference-guide.html

purcell commented 9 years ago

Aha, indeed. I haven't used airspeed myself for a little while, but @dbaxa has been doing a bunch of great work to bring it up to par. Perhaps this is a feature he's looked at implementing?