access templates from within a zip (via zipfile module?)

13 views
Skip to first unread message

Alexander Krause

unread,
Apr 26, 2017, 8:14:15 AM4/26/17
to Mako Templates for Python
Hi there!

Did anyone tried to implement something to access mako templates from a zipfile?

For deployment (py2exe) I'd like to directly read a template without extracting it to a temporary folder from a zip.

At the moment I'm trying to overload some of the filesystem functions of mako but I was wondering if it might also be possible via a special TemplateLookup class?

Thanks for hints and have a great day!

mike bayer

unread,
Apr 26, 2017, 1:26:28 PM4/26/17
to mako-d...@googlegroups.com


On 04/26/2017 08:14 AM, 'Alexander Krause' via Mako Templates for Python
wrote:
I don't have much to add here except, "yes", a custom TemplateLookup
could pull the files from a zip as a source. The base class is
TemplateCollection which is "abstract", I'd use that as a base.


>
> --
> You received this message because you are subscribed to the Google
> Groups "Mako Templates for Python" group.
> To unsubscribe from this group and stop receiving emails from it, send
> an email to mako-discuss...@googlegroups.com
> <mailto:mako-discuss...@googlegroups.com>.
> To post to this group, send email to mako-d...@googlegroups.com
> <mailto:mako-d...@googlegroups.com>.
> Visit this group at https://groups.google.com/group/mako-discuss.
> For more options, visit https://groups.google.com/d/optout.

Alexander Krause

unread,
Apr 26, 2017, 3:22:10 PM4/26/17
to Mako Templates for Python
I've uploaded my progress to github:

Examples are there and the use should be pretty easy to.

Basically it already seems to work but I'm open for comments.

Regards,
Alex
Reply all
Reply to author
Forward
0 new messages