[ZPT] Debugging helpers
richard@bizarsoftware.com.au
richard@bizarsoftware.com.au
Mon, 09 Apr 2001 10:50:38 +1000
richard@bizarsoftware.com.au wrote:
> In PageTemplate.pr_render, I have:
>
> def pt_render(self, source=0, extra_context={}):
> """Render this Page Template"""
> if self._v_errors:
> return self.pt_diagnostic()
> output = StringIO()
> c = self.pt_getContext()
> c.update(extra_context)
> #__traceback_info__ = c
> if Globals.DevelopmentMode:
> __traceback_info__ = pprint.pformat(c)
>
> again, the traceback info is handy to have, but it's annoying when not
> pretty-formatted.
Oh, and by default, we always comment out the __repr__=__str__ line in
HTTPRequest and BaseRequest. That also reduces the verbosity of exceptions
(and we have no reason to want __repr__ == __str__).
Richard
--
Richard Jones
richard@bizarsoftware.com.au
Senior Software Developer, Bizar Software (www.bizarsoftware.com.au)