[Patches] [ python-Patches-569574 ] plain text enhancement for cgitb

noreply@sourceforge.net noreply@sourceforge.net
Tue, 09 Jul 2002 20:33:11 -0700


Patches item #569574, was opened at 2002-06-15 21:46
You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=305470&aid=569574&group_id=5470

Category: Library (Lib)
Group: Python 2.3
Status: Open
Resolution: None
Priority: 5
Submitted By: Skip Montanaro (montanaro)
Assigned to: Ka-Ping Yee (ping)
Summary: plain text enhancement for cgitb

Initial Comment:
Here's a patch to cgitb that allows you to enable plain
text output.  It adds an extra variable to the cgitb.enable
function and corresponding underlying functions.  To get
plain text invoke it as

    import cgitb
    cgitb.enable(format="text")

(actually, any value for format other than "html" will 
enable plain text output).  The default value is "html", so 
existing usage of cgitb should be unaffected.

I realize this isn't quite what you suggested, but it 
seemed to me worthwhile to keep such similar code 
together.

I'm not entirely certain I haven't fouled up the html
formatting.  It needs to be checked still.  Also still to come
is a doc change.

Skip


----------------------------------------------------------------------

>Comment By: Ka-Ping Yee (ping)
Date: 2002-07-09 20:33

Message:
Logged In: YES 
user_id=45338

I think enhanced text tracebacks would be great.

(I even have my own hacked-up one lying around
here somewhere -- it colourized the output.  I think
a part of me was waiting for an opportunity to
make enhanced tracebacks standard. The most
important enhancement IMHO is to show argument
values.)

I don't think the functionality belongs in cgitb,
though.  The main routine probably should go
in traceback; the common routines (scanvars
and lookup) can go there too.

----------------------------------------------------------------------

Comment By: Skip Montanaro (montanaro)
Date: 2002-07-09 16:48

Message:
Logged In: YES 
user_id=44345

Ping

How about you?  As the author I think you're in the best position to
decide on the merits of the patch...

Skip


----------------------------------------------------------------------

Comment By: Guido van Rossum (gvanrossum)
Date: 2002-06-19 20:36

Message:
Logged In: YES 
user_id=6380

Unassigning -- I won't get to this before my vacation.

----------------------------------------------------------------------

Comment By: Skip Montanaro (montanaro)
Date: 2002-06-15 22:09

Message:
Logged In: YES 
user_id=44345

Okay, here's a correction to the first patch.  It fixes the logic
bug that corrupted the HTML output.  It also adds a little bit
of extra documentation.

Writing the documentation made me think that perhaps this
should be added to the traceback module as Guido
suggested with just a stub cgitb module that provides an 
enable function that calls the enable function in the 
traceback module with format="html".  The cgitb module
could then be deprecated.

----------------------------------------------------------------------

You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=305470&aid=569574&group_id=5470