[Zope3-checkins] CVS: Zope3/src/zope/app/interfaces -
interpreter.py:1.1.2.1 size.py:1.4.32.1
Stephan Richter
srichter at cosmos.phy.tufts.edu
Wed Aug 20 21:11:41 EDT 2003
Update of /cvs-repository/Zope3/src/zope/app/interfaces
In directory cvs.zope.org:/tmp/cvs-serv26608/interfaces
Modified Files:
Tag: srichter-inlinepython-branch
size.py
Added Files:
Tag: srichter-inlinepython-branch
interpreter.py
Log Message:
Hooked up the new TAL script support to Templated Pages. The support has to
be manually activated on a separate page (as requested by __gotcha).
Also, currently we only have support for the "text/server-python" type.
Later we might want to add other languages too.
TO DO:
- tests
- documentation
=== Added File Zope3/src/zope/app/interfaces/interpreter.py ===
##############################################################################
#
# Copyright (c) 2002 Zope Corporation and Contributors.
# All Rights Reserved.
#
# This software is subject to the provisions of the Zope Public License,
# Version 2.0 (ZPL). A copy of the ZPL should accompany this distribution.
# THIS SOFTWARE IS PROVIDED "AS IS" AND ANY AND ALL EXPRESS OR IMPLIED
# WARRANTIES ARE DISCLAIMED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
# WARRANTIES OF TITLE, MERCHANTABILITY, AGAINST INFRINGEMENT, AND FITNESS
# FOR A PARTICULAR PURPOSE.
#
##############################################################################
"""Interfaces for Code Interpreters
$Id: interpreter.py,v 1.1.2.1 2003/08/21 00:11:10 srichter Exp $
"""
from zope.interface import Interface
class IInterpreterService(Interface):
"""An interpreter service manages the available code interpreters.
Code interpreters are registered by type, which should be valid content
type entries based on the W3C standards. An example would be
'text/server-python'.
"""
def getInterpreter(type):
"""Return the interpreter for this type.
If no interpreter is found, raise a ComponentLookupError.
"""
def queryInterpreter(type, default=None):
"""Return the interpreter for this type.
If no interpreter is found, return the default value.
"""
class IGlobalInterpreterService(IInterpreterService):
def provideInterpreter(type, interpreter):
"""Register a new interpreter with the service."""
class IInterpreter(Interface):
def evaluate(code, globals):
"""Evaluate the code given the global variables."""
def evaluateRawCode(code, globals):
"""Evaluate the code given the global variables.
However, this method does a little bit more. Sometimes (or in our case
often) code might come from an uncontrolled environment, like a page
template and is not properly formatted, i.e. indentation, so that some
cleanup is necessary. This method does the cleanup before evaluating
the code.
"""
=== Zope3/src/zope/app/interfaces/size.py 1.4 => 1.4.32.1 ===
--- Zope3/src/zope/app/interfaces/size.py:1.4 Thu May 1 15:35:21 2003
+++ Zope3/src/zope/app/interfaces/size.py Wed Aug 20 20:11:10 2003
@@ -1,4 +1,3 @@
-
##############################################################################
#
# Copyright (c) 2002 Zope Corporation and Contributors.
More information about the Zope3-Checkins
mailing list