purcell / airspeed

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

Support Strict Reference mode #39

Open tuukkamustonen opened 4 years ago

tuukkamustonen commented 4 years ago

Looks like Strict Reference mode is not supported, correct?

tuukkamustonen commented 4 years ago

I think https://github.com/purcell/airspeed/blob/master/airspeed/__init__.py#L607 would be the place to add it?

purcell commented 4 years ago

No, it's not supported, and yes, I think that would be the right place to make a change. It's not clear where we'd set and store a value indicating whether strict mode is enabled. We don't really have anything analogous to velocity's config vars at this stage.

tuukkamustonen commented 4 years ago

I'll take a closer look at the code and try to hack in something (not sure if we absolutely need this feature, so there are conditionals). If I manage to produce something working, I'll send a PR.

Maybe the loader could store some config map? It's already passed around a lot. Though, semantically it's the wrong place to put configs (as it's only for #include and #parse), but it's force-initialized so could work as a vessel to carry out the configs.