[Zope3-checkins] CVS: Zope3/src/zope/app/pagetemplate - engine.py:1.23

Stephan Richter srichter at cosmos.phy.tufts.edu
Tue Mar 2 09:25:01 EST 2004


Update of /cvs-repository/Zope3/src/zope/app/pagetemplate
In directory cvs.zope.org:/tmp/cvs-serv21657/src/zope/app/pagetemplate

Modified Files:
	engine.py 
Log Message:


I originally added queryService() to ZAPI and this should have never been
done. Remove it and use getService() in the places where it was used instead.




=== Zope3/src/zope/app/pagetemplate/engine.py 1.22 => 1.23 ===
--- Zope3/src/zope/app/pagetemplate/engine.py:1.22	Fri Feb 27 17:25:24 2004
+++ Zope3/src/zope/app/pagetemplate/engine.py	Tue Mar  2 09:24:31 2004
@@ -22,14 +22,11 @@
 import sys
 from types import StringTypes
 
-from zope.tales.expressions import PathExpr
-from zope.tales.expressions import StringExpr
-from zope.tales.expressions import NotExpr
-from zope.tales.expressions import DeferExpr
+from zope.tales.expressions import PathExpr, StringExpr, NotExpr, DeferExpr
 from zope.tales.pythonexpr import PythonExpr
-from zope.tales.tales import ExpressionEngine
-from zope.tales.tales import Context
+from zope.tales.tales import ExpressionEngine, Context
 
+from zope.component.exceptions import ComponentLookupError
 from zope.proxy import removeAllProxies
 from zope.security.proxy import ProxyFactory
 from zope.security.builtins import RestrictedBuiltins
@@ -99,8 +96,9 @@
                   _('Inline Code Evaluation is deactivated, which means that '
                     'you cannot have inline code snippets in your Page '
                     'Template. Activate Inline Code Evaluation and try again.')
-        service = zapi.queryService(self.context, 'Interpreter')
-        if service is None:
+        try:
+            service = zapi.getService(self.context, 'Interpreter')
+        except ComponentLookupError, err:
             raise InlineCodeError, \
                   _('No interpreter service was found. This should never '
                     'happen, since Zope defines a global interpreter service.')




More information about the Zope3-Checkins mailing list