One of our page templates is made up of a bunch of macros. These items are a bunch of html tables.
Now, I want a couple of these tables in a Python script to create a PDF. Is there a way call a macro from a Python script and get back the HTML that is produced?
If so, can you explain?
Thanks
Eric
Maybe you could create a new template including (use-macro) just the macros you want to access from python and then use z3c.pt.pagetemplate.PageTemplateFile() to render it?
Actually, it might be possible (and certainly easier) to use chameleon.zpt.template.PageTemplate('<div tal:use-macro="<your-macro-here>" />'), but I've never did this myself.
Call macro from Python script?