[Zope3-checkins] SVN: Zope3/trunk/src/zope/app/pagetemplate/viewpagetemplatefile.py Use getattr to access debug flags, so as not to depend on values

Jim Fulton jim at zope.com
Wed Apr 6 11:57:55 EDT 2005


Log message for revision 29890:
  Use getattr to access debug flags, so as not to depend on values
  set by server.
  

Changed:
  U   Zope3/trunk/src/zope/app/pagetemplate/viewpagetemplatefile.py

-=-
Modified: Zope3/trunk/src/zope/app/pagetemplate/viewpagetemplatefile.py
===================================================================
--- Zope3/trunk/src/zope/app/pagetemplate/viewpagetemplatefile.py	2005-04-06 15:36:16 UTC (rev 29889)
+++ Zope3/trunk/src/zope/app/pagetemplate/viewpagetemplatefile.py	2005-04-06 15:57:54 UTC (rev 29890)
@@ -45,8 +45,11 @@
             request=instance.request,
             instance=instance, args=args, options=keywords)
         debug_flags = instance.request.debug
-        s = self.pt_render(namespace, showtal=debug_flags.showTAL,
-                           sourceAnnotations=debug_flags.sourceAnnotations)
+        s = self.pt_render(
+            namespace,
+            showtal=getattr(debug_flags, 'showTAL', 0),
+            sourceAnnotations=getattr(debug_flags, 'sourceAnnotations', 0),
+            )
         response = instance.request.response
         if not response.getHeader("Content-Type"):
             response.setHeader("Content-Type", self.content_type)



More information about the Zope3-Checkins mailing list