Alter mako-render to add template_dir directories to sys.path
Derek Harland
Branch: Deleted repository:patch-mako-render-python-path
Branch: zzzeek/mako:master
Declined
Declined pull request
No longer relevant
Closed by: Derek Harland·2014-04-29
No longer relevant
The python interpreter will prepend
sys.path
with the parent directory of the script it is running (or the current directory if the script comes fromstdin
).It would be nice for
mako-render
to behave similarly. As it stands, we cannot easily import local python modules (via the<namespace>
tag) that sit along side templates. Thus a template can't import helper functions that have been defined in a python module, unless we manage to put that module into the "global" python path.This patch extends my previous patch, that added
--template-dir
, to also add these directories to the python path