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

Stephan Richter srichter at cosmos.phy.tufts.edu
Thu Aug 21 09:04:05 EDT 2003


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

Modified Files:
      Tag: srichter-inlinepython-branch
	engine.py 
Log Message:
Inserted Module Doc Strings.


=== Zope3/src/zope/app/pagetemplate/engine.py 1.18.14.1 => 1.18.14.2 ===
--- Zope3/src/zope/app/pagetemplate/engine.py:1.18.14.1	Wed Aug 20 20:11:12 2003
+++ Zope3/src/zope/app/pagetemplate/engine.py	Thu Aug 21 08:03:35 2003
@@ -38,9 +38,13 @@
 from zope.i18n.translate import Translator
 
 from zope.app import zapi
+from zope.app.i18n import ZopeMessageIDFactory as _
 from zope.app.traversing.adapters import Traverser
 
 
+class InlineCodeError(Exception):
+    pass
+
 def zopeTraverser(object, path_items, econtext):
     """Traverses a sequence of names, first trying attributes then items.
     """
@@ -93,7 +97,10 @@
 
     def evaluateCode(self, lang, code):
         if not self.evaluateInlineCode:
-            raise 'InlineCodeError', 'Inline Code Evaluation is deactivated.'
+            raise InlineCodeError, \
+                  _('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)
         globals = self.vars.copy()




More information about the Zope3-Checkins mailing list