defunkt / pystache

Mustache in Python
http://mustache.github.com/
MIT License
1.31k stars 308 forks source link

added ability to provide a path to a template file #205

Open jgstew opened 4 years ago

jgstew commented 4 years ago

allows pystache.render to take a file path string to a template file as the template argument. This should be safe because it would be hard to craft a valid template string that is also a valid path to a real file. (the logic only triggers if the argument is a string that points to a valid readable file)

I did run the pystache tests including the spec ones, all passed.

jgstew commented 4 years ago

it occurs to me, I don't know if self should be in the function call to render_path or not.

jgstew commented 4 years ago

kind of forgot that further commits to master would be included in the pull request automatically.

jgstew commented 4 years ago

I reverted the extra changes I made, so now it is just the one change in the diff / pull request.