Class
zope.app.pagetemplate.engine.TrustedZopeEngine

Trusted expression engine.

This engine allows modules to be imported:

>>> modname = 'zope.app.pagetemplate.tests.trusted'
>>> engine = _TrustedEngine()
>>> context = engine.getContext(engine.getBaseNames())

>>> modname in sys.modules
False
>>> m = context.evaluate('modules/' + modname)
>>> m.__name__ == modname
True
>>> modname in sys.modules
True

Since this is trusted code, we can look at whatever is in the module, not just __name__ or what's declared in a security assertion:

>>> m.x
42

Clean up after ourselves:

>>> del sys.modules[modname]

Base classes

Implemented Interfaces

Attributes/Properties

There are no attributes in this class.

Methods

Known Subclasses

There are no known subclasses.