Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code | Sign in
(11)

Side by Side Diff: Lib/cgitb.py

Issue 10639: reindent.py converts newlines to platform default
Patch Set: Created 8 years, 8 months ago
Left:
Right:
Use n/p to move between diff chunks; N/P to move between comments. Please Sign in to add in-line comments.
Jump to:
View unified diff | Download patch
« no previous file with comments | « Lib/cgi.py ('k') | Lib/concurrent/futures/process.py » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 """More comprehensive traceback formatting for Python scripts. 1 """More comprehensive traceback formatting for Python scripts.
2 2
3 To enable this module, do: 3 To enable this module, do:
4 4
5 import cgitb; cgitb.enable() 5 import cgitb; cgitb.enable()
6 6
7 at the top of your script. The optional arguments to enable() are: 7 at the top of your script. The optional arguments to enable() are:
8 8
9 display - if true, tracebacks are displayed in the web browser 9 display - if true, tracebacks are displayed in the web browser
10 logdir - if set, tracebacks are written to files in this directory 10 logdir - if set, tracebacks are written to files in this directory
(...skipping 13 matching lines...) Expand all
24 import inspect 24 import inspect
25 import keyword 25 import keyword
26 import linecache 26 import linecache
27 import os 27 import os
28 import pydoc 28 import pydoc
29 import sys 29 import sys
30 import tempfile 30 import tempfile
31 import time 31 import time
32 import tokenize 32 import tokenize
33 import traceback 33 import traceback
34 import types
34 35
35 def reset(): 36 def reset():
36 """Return a string that resets the CGI and browser to a known state.""" 37 """Return a string that resets the CGI and browser to a known state."""
37 return '''<!--: spam 38 return '''<!--: spam
38 Content-Type: text/html 39 Content-Type: text/html
39 40
40 <body bgcolor="#f0f0f8"><font color="#f0f0f8" size="-5"> --> 41 <body bgcolor="#f0f0f8"><font color="#f0f0f8" size="-5"> -->
41 <body bgcolor="#f0f0f8"><font color="#f0f0f8" size="-5"> --> --> 42 <body bgcolor="#f0f0f8"><font color="#f0f0f8" size="-5"> --> -->
42 </font> </font> </font> </script> </object> </blockquote> </pre> 43 </font> </font> </font> </script> </object> </blockquote> </pre>
43 </table> </table> </table> </table> </table> </font> </font> </font>''' 44 </table> </table> </table> </table> </table> </font> </font> </font>'''
(...skipping 262 matching lines...) Expand 10 before | Expand all | Expand 10 after
306 307
307 handler = Hook().handle 308 handler = Hook().handle
308 def enable(display=1, logdir=None, context=5, format="html"): 309 def enable(display=1, logdir=None, context=5, format="html"):
309 """Install an exception handler that formats tracebacks as HTML. 310 """Install an exception handler that formats tracebacks as HTML.
310 311
311 The optional argument 'display' can be set to 0 to suppress sending the 312 The optional argument 'display' can be set to 0 to suppress sending the
312 traceback to the browser, and 'logdir' can be set to a directory to cause 313 traceback to the browser, and 'logdir' can be set to a directory to cause
313 tracebacks to be written to files there.""" 314 tracebacks to be written to files there."""
314 sys.excepthook = Hook(display=display, logdir=logdir, 315 sys.excepthook = Hook(display=display, logdir=logdir,
315 context=context, format=format) 316 context=context, format=format)
OLDNEW
« no previous file with comments | « Lib/cgi.py ('k') | Lib/concurrent/futures/process.py » ('j') | no next file with comments »

RSS Feeds Recent Issues | This issue
This is Rietveld 894c83f36cb7+