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

Stephan Richter srichter at cosmos.phy.tufts.edu
Tue Mar 2 10:50:35 EST 2004


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

Modified Files:
	engine.py 
Log Message:


Updated other code to use interpreter utilities instead of interpreter
service.


=== Zope3/src/zope/app/pagetemplate/engine.py 1.23 => 1.24 ===
--- Zope3/src/zope/app/pagetemplate/engine.py:1.23	Tue Mar  2 09:24:31 2004
+++ Zope3/src/zope/app/pagetemplate/engine.py	Tue Mar  2 10:50:03 2004
@@ -26,6 +26,7 @@
 from zope.tales.pythonexpr import PythonExpr
 from zope.tales.tales import ExpressionEngine, Context
 
+from zope.component.servicenames import Utilities
 from zope.component.exceptions import ComponentLookupError
 from zope.proxy import removeAllProxies
 from zope.security.proxy import ProxyFactory
@@ -34,6 +35,7 @@
 
 from zope.app import zapi
 from zope.app.i18n import ZopeMessageIDFactory as _
+from zope.app.interpreter.interfaces import IInterpreter
 from zope.app.traversing.adapters import Traverser
 
 
@@ -96,13 +98,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.')
-        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.')
-        interpreter = service.queryInterpreter(lang)
+
+        service = zapi.getService(self.context, Utilities)
+        interpreter = service.queryUtility(IInterpreter, name=lang)
         if interpreter is None:
             error = _('No interpreter named "${lang_name}" was found.')
             error.mapping = {'lang_name': lang}




More information about the Zope3-Checkins mailing list