diff --git a/roundup/cgitb.py b/roundup/cgitb.py
index 8519a97215b16cc3743c6805db9c834d1d82fbfc..d7837ca055ca14beb80b49ef1581989876a5494a 100644 (file)
--- a/roundup/cgitb.py
+++ b/roundup/cgitb.py
#
-# Copyright (c) 2001 Bizar Software Pty Ltd (http://www.bizarsoftware.com.au/)
-# This module is free software, and you may redistribute it and/or modify
-# under the same terms as Python, so long as this copyright message and
-# disclaimer are retained in their original form.
-#
-# IN NO EVENT SHALL BIZAR SOFTWARE PTY LTD BE LIABLE TO ANY PARTY FOR
-# DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES ARISING
-# OUT OF THE USE OF THIS CODE, EVEN IF THE AUTHOR HAS BEEN ADVISED OF THE
-# POSSIBILITY OF SUCH DAMAGE.
-#
-# BIZAR SOFTWARE PTY LTD SPECIFICALLY DISCLAIMS ANY WARRANTIES, INCLUDING,
-# BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
-# FOR A PARTICULAR PURPOSE. THE CODE PROVIDED HEREUNDER IS ON AN "AS IS"
-# BASIS, AND THERE IS NO OBLIGATION WHATSOEVER TO PROVIDE MAINTENANCE,
-# SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS.
+# This module was written by Ka-Ping Yee, <ping@lfw.org>.
#
-# $Id: cgitb.py,v 1.5 2001-08-07 00:24:42 richard Exp $
+# $Id: cgitb.py,v 1.10 2002-01-16 04:49:45 richard Exp $
+
+__doc__ = """
+Extended CGI traceback handler by Ka-Ping Yee, <ping@lfw.org>.
+"""
import sys, os, types, string, keyword, linecache, tokenize, inspect, pydoc
+from i18n import _
+
def breaker():
return ('<body bgcolor="#f0f0ff">' +
'<font color="#f0f0ff" size="-5"> > </font> ' +
'<font size=+1><strong>%s</strong>: %s</font>'%(str(etype), str(evalue)),
'#ffffff', '#aa55cc', pyver)
- head = head + ('<p>A problem occurred while running a Python script. '
+ head = head + (_('<p>A problem occurred while running a Python script. '
'Here is the sequence of function calls leading up to '
'the error, with the most recent (innermost) call first. '
- 'The exception attributes are:')
+ 'The exception attributes are:'))
indent = '<tt><small>%s</small> </tt>' % (' ' * 5)
traceback = []
<table width="100%%" bgcolor="#d8bbff" cellspacing=0 cellpadding=2 border=0>
<tr><td>%s %s</td></tr></table>''' % (link, call)
- if file is None:
+ if index is None or file is None:
traceback.append('<p>' + level)
continue
if locals.has_key(name):
value = pydoc.html.repr(locals[name])
else:
- value = '<em>undefined</em>'
+ value = _('<em>undefined</em>')
name = '<strong>%s</strong>' % name
else:
if frame.f_globals.has_key(name):
value = pydoc.html.repr(frame.f_globals[name])
else:
- value = '<em>undefined</em>'
+ value = _('<em>undefined</em>')
name = '<em>global</em> <strong>%s</strong>' % name
lvals.append('%s = %s' % (name, value))
if lvals:
#
# $Log: not supported by cvs2svn $
+# Revision 1.9 2002/01/08 11:56:24 richard
+# missed an import _
+#
+# Revision 1.8 2002/01/05 02:22:32 richard
+# i18n'ification
+#
+# Revision 1.7 2001/11/22 15:46:42 jhermann
+# Added module docstrings to all modules.
+#
+# Revision 1.6 2001/09/29 13:27:00 richard
+# CGI interfaces now spit up a top-level index of all the instances they can
+# serve.
+#
+# Revision 1.5 2001/08/07 00:24:42 richard
+# stupid typo
+#
# Revision 1.4 2001/08/07 00:15:51 richard
# Added the copyright/license notice to (nearly) all files at request of
# Bizar Software.