Page Templates

Page Template module

HTML- and XML-based template objects using TAL, TALES, and METAL.

class zope.pagetemplate.pagetemplate.StringIO(value=None)[source]

Bases: list

write()

L.append(object) – append object to end

class zope.pagetemplate.pagetemplate.PageTemplate[source]

Bases: object

Page Templates using TAL, TALES, and METAL.

Subclassing

This class implements IPageTemplateSubclassing.

The following methods have certain internal responsibilities.

pt_getContext(**keywords)
Should ignore keyword arguments that it doesn’t care about, and construct the namespace passed to the TALES expression engine. This method is free to use the keyword arguments it receives.
pt_render(namespace, source=False, sourceAnnotations=False, showtal=False)
Responsible the TAL interpreter to perform the rendering. The namespace argument is a mapping which defines the top-level namespaces passed to the TALES expression engine.
__call__(*args, **keywords)
Calls pt_getContext() to construct the top-level namespace passed to the TALES expression engine, then calls pt_render() to perform the rendering.
pt_render(namespace, source=False, sourceAnnotations=False, showtal=False)[source]

Render this Page Template

read(request=None)[source]

Gets the source, sometimes with macros expanded.

pt_source_file()[source]

To be overridden.

exception zope.pagetemplate.pagetemplate.PTRuntimeError[source]

Bases: exceptions.RuntimeError

The Page Template has template errors that prevent it from rendering.

class zope.pagetemplate.pagetemplate.PageTemplateEngine(program)[source]

Bases: object

Page template engine that uses the TAL interpreter to render.

This class implements zope.pagetemplate.interfaces.IPageTemplateProgram.

Filesystem Page Template module

Zope object encapsulating a Page Template from the filesystem.

class zope.pagetemplate.pagetemplatefile.PageTemplateFile(filename, _prefix=None)[source]

Bases: zope.pagetemplate.pagetemplate.PageTemplate

Zope wrapper for filesystem Page Template using TAL, TALES, and METAL

pt_source_file()[source]

To be overridden.