purcell / airspeed

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

Add support for additional Java-like methods #24

Closed whummer closed 8 years ago

whummer commented 8 years ago

@purcell Thanks for providing this awesome framework, it makes our life so much easier! Our main use case is creating local mocks for AWS API Gateway request templates.

This PR adds support for additional methods, to provide better compatibility with Java-based Velocity template implementations (e.g., AWS API Gateway).

In particular, this PR allows to call size() on objects of type list, and length() on objects of type str. Additional methods can be easily added to the configuration in the future.

purcell commented 8 years ago

Awesome, thanks!

purcell commented 8 years ago

Released as 0.5.5. Very happy to hear this code is useful to you. I haven't used it myself for 10+ years. :-)