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

Stephan Richter srichter at cosmos.phy.tufts.edu
Thu Aug 21 10:13:32 EDT 2003


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

Modified Files:
      Tag: srichter-inlinepython-branch
	engine.py 
Log Message:
Fixed a bug in Templated Page (due to my changes)

Added global versus local veriable test for zope.security.interpreter

Added a couple of HTMLTALParser tests.


=== Zope3/src/zope/app/pagetemplate/engine.py 1.18.14.2 => 1.18.14.3 ===
--- Zope3/src/zope/app/pagetemplate/engine.py:1.18.14.2	Thu Aug 21 08:03:35 2003
+++ Zope3/src/zope/app/pagetemplate/engine.py	Thu Aug 21 09:13:01 2003
@@ -101,8 +101,17 @@
                   _('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.getService(self.context, 'Interpreter')
-        interpreter = service.getInterpreter(lang)
+        service = zapi.queryService(self.context, 'Interpreter')
+        if service is None:
+            raise InlineCodeError, \
+                  _('No interpreter service was found. This should never '
+                    'happen, since Zope defines a global interpreter service.')
+        interpreter = service.queryInterpreter(lang)
+        if interpreter is None:
+            error = _('No interpreter named "${lang_name}" was found.')
+            error.mapping = {'lang_name': lang}
+            raise InlineCodeError, error
+                  
         globals = self.vars.copy()
         result = interpreter.evaluateRawCode(code, globals)
         # Add possibly new global variables.




More information about the Zope3-Checkins mailing list