summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 929b8a2)
raw | patch | inline | side by side (parent: 929b8a2)
author | richard <richard@57a73879-2fb5-44c3-a270-3262357dd7e2> | |
Mon, 19 Aug 2002 00:21:37 +0000 (00:21 +0000) | ||
committer | richard <richard@57a73879-2fb5-44c3-a270-3262357dd7e2> | |
Mon, 19 Aug 2002 00:21:37 +0000 (00:21 +0000) |
git-svn-id: http://svn.roundup-tracker.org/svnroot/roundup/trunk@963 57a73879-2fb5-44c3-a270-3262357dd7e2
roundup/htmltemplate.py | patch | blob | history |
index d1fd2523307e6cd8f96ce08e226a020e34ba1520..a3578e6805c46fe6aa6479ed967b47b7202435e3 100644 (file)
--- a/roundup/htmltemplate.py
+++ b/roundup/htmltemplate.py
# BASIS, AND THERE IS NO OBLIGATION WHATSOEVER TO PROVIDE MAINTENANCE,
# SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS.
#
-# $Id: htmltemplate.py,v 1.111 2002-08-15 00:40:10 richard Exp $
+# $Id: htmltemplate.py,v 1.112 2002-08-19 00:21:37 richard Exp $
__doc__ = """
Template engine.
a template function, add a test for all data types or the angry pink bunny
will hunt you down.
"""
-import weakref, os, types, cgi, sys, urllib, re
+import weakref, os, types, cgi, sys, urllib, re, traceback
+try:
+ import cStringIO as StringIO
+except ImportError:
+ import StringIO
try:
import cPickle as pickle
except ImportError:
try:
self._render()
except:
- etype = sys.exc_type
- if type(etype) is types.ClassType:
- etype = etype.__name__
- w('<p class="system-msg">%s: %s</p>'%(etype, sys.exc_value))
# make sure we don't commit any changes
self.client.db.rollback()
+ s = StringIO.StringIO()
+ traceback.print_exc(None, s)
+ w('<pre class="system-msg">%s</pre>'%cgi.escape(s.getvalue()))
w('</form>')
finally:
self.cl = self.properties = self.client = None
#
# $Log: not supported by cvs2svn $
+# Revision 1.111 2002/08/15 00:40:10 richard
+# cleanup
+#
# Revision 1.110 2002/08/13 20:16:09 gmcm
# Use a real parser for templates.
# Rewrite htmltemplate to use the parser (hack, hack).