*** cgitb.py-orig 2004-07-07 12:52:19.000000000 +0200 --- cgitb.py 2004-07-07 13:22:36.000000000 +0200 *************** *** 35,47 **** --> --> ''' __UNDEF__ = [] # a special sentinel object ! def small(text): return '' + text + '' ! def strong(text): return '' + text + '' ! def grey(text): return '' + text + '' def lookup(name, frame, locals): """Find the value for a given name in the given environment.""" if name in locals: return 'local', locals[name] --- 35,61 ---- --> --> ''' __UNDEF__ = [] # a special sentinel object ! def small(text): ! if text: ! return '' + text + '' ! else: ! return '' ! ! def strong(text): ! if text: ! return '' + text + '' ! else: ! return '' ! ! def grey(text): ! if text: ! return '' + text + '' ! else: ! return '' def lookup(name, frame, locals): """Find the value for a given name in the given environment.""" if name in locals: return 'local', locals[name] *************** *** 86,99 **** if type(etype) is types.ClassType: etype = etype.__name__ pyver = 'Python ' + sys.version.split()[0] + ': ' + sys.executable date = time.ctime(time.time()) head = '' + pydoc.html.heading( ! '%s' % str(etype), '#ffffff', '#6622aa', pyver + '
' + date) + '''

A problem occurred in a Python script. Here is the sequence of ! function calls leading up to the error, in the order they occurred.''' indent = '' + small(' ' * 5) + ' ' frames = [] records = inspect.getinnerframes(etb, context) for frame, file, lnum, func, lines, index in records: --- 100,114 ---- if type(etype) is types.ClassType: etype = etype.__name__ pyver = 'Python ' + sys.version.split()[0] + ': ' + sys.executable date = time.ctime(time.time()) head = '' + pydoc.html.heading( ! '%s' % ! strong(pydoc.html.escape(str(etype))), '#ffffff', '#6622aa', pyver + '
' + date) + '''

A problem occurred in a Python script. Here is the sequence of ! function calls leading up to the error, in the order they occurred.

''' indent = '' + small(' ' * 5) + ' ' frames = [] records = inspect.getinnerframes(etb, context) for frame, file, lnum, func, lines, index in records: *************** *** 140,150 **** dump.append('%s = %s' % (name, pydoc.html.repr(value))) else: dump.append(name + ' undefined') rows.append('%s' % small(grey(', '.join(dump)))) ! frames.append('''

%s
''' % '\n'.join(rows)) exception = ['

%s: %s' % (strong(pydoc.html.escape(str(etype))), pydoc.html.escape(str(evalue)))] --- 155,165 ---- dump.append('%s = %s' % (name, pydoc.html.repr(value))) else: dump.append(name + ' undefined') rows.append('%s' % small(grey(', '.join(dump)))) ! frames.append(''' %s
''' % '\n'.join(rows)) exception = ['

%s: %s' % (strong(pydoc.html.escape(str(etype))), pydoc.html.escape(str(evalue)))]