-
Notifications
You must be signed in to change notification settings - Fork 4
Introduce support for jinja2-based templates. #210
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: next
Are you sure you want to change the base?
Conversation
6c221a4
to
eb8f895
Compare
e42acc7
to
21a5ef0
Compare
f718ae4
to
6abeec6
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
From a first glance it looks sensible and usable enough.
I still would like a short write-up or analysis of what we want / need and some sort of brief evaluation of available template engines including features and performance. Bonus for thoughts and numbers backing the choice of granularity to be the individual output object entries.
We may still very well go with jinja2 but just to make sure it's in fact the best match.
This being a draft I'll refrain from commenting much on the obvious polish missing before it's ripe for actual merging, but from a quick glance you probably want to fix a few typos in var and function names, go over license headers and consider doc strings :)
6abeec6
to
d8a9b39
Compare
Recent changes to the linting checks have resulted in any changes in and around configuration fail in CI with the complaint that logger is not defined. In trying to understand what was happening it was found that some amount of confusion was occurring having both logger and logger_obj properties. Attempt to fix this by: 1) unconditionally defining both properties 2) always setting both properties 3) determining the type of logger being assigned and set the internal properties as appropriate Expanding on the latter, loggers are almost always set as assignment to .logger, but this was not always being passed the same kind of object. At times this was a bare logger (i.e. info(), .debug() etc) but sometimes it was something with .reopen() which would then simply be thrown away and thus reload() would not actually work. Fix this by detecting a .reopen() method and correctly referencing such an object.
This change adds a small namespace to configuraton objects that behaves like a dictonary allowing objects to made available to e.g. request handlers. Opt to do this by specialising Configuration rather than changing it directly. The rationale is to preserve a distinction between static parts of the configuration of a dpeloyment, which do no change at runtime, versus e.g. a users locale which would be different for each request though consistent for its duration. Such functionality it needed to support templates without restorting to globals within the current system architecture; only congifuration objects are already threaded through most of the places this would need to be available with the correct semantics of an instance being created wherever it is needed. RuntimeConfiguration
d8a9b39
to
8a9e55b
Compare
This addds the necessary logic both to maintain a store of templates and makiung them available for serving within any page via a new template object type. Make sure there is a separation of the test templates from the mainline stuff by wiring a TEMPLATES section into Configuration and reading the necessary paths via the loaded configuration. Doing so allows both source location and the cache directory to be optionally specified via the main ini file and thus are runtime accessible without hard-coding. Use this facility within the tests to adjust the paths.
b451c4e
to
5a36ff2
Compare
Remaining lint failures are in pre-existing code unchanged by this PR. |
No description provided.