[twill] How to output text on the screen to a log file

Do, Uy N Uy_Do at reyrey.com
Tue Mar 28 09:06:41 PST 2006


Amazing! 
I tried 'config use_tidy 0' and it worked like a charm. 
However, using the redirect_output method, I could catch the exception
that thowed on the screen.
For example, I got an exception like this on the screen: 
------------
EXCEPTION raised at line 18 of 't1.py'
Formvalue 1 '..fieldname'...
Error message: 'no field matches'...
** UNHANDLE EXCEPTION: no field matches 'fieldname'..
...
------------
And it stops right there, ignoring the rest of the scripts.
Questions: 
- How could I catch that error to a log file?
- Is there a way to just let the script continue executing till the end
of the file, without stopping at the first error it finds?

I really like the product now. Easy to use, fast and great support!
Uy

-----Original Message-----
From: Titus Brown [mailto:titus at caltech.edu] 
Sent: Tuesday, March 28, 2006 10:29 AM
To: Do, Uy N
Cc: twill at lists.idyll.org
Subject: Re: [twill] How to output text on the screen to a log file

-> I updated to the latest egg (twill-0.8.5a1-py2.4.egg) on windows
using
-> easy_install and it worked like a charm.
-> I didn't open the file while I ran the script. Actually, I tried both
-> versions using twill-sh script and python script but the result was
the
-> same. The file was still there after I exited twill, but its filesize
is
-> 0 byte as I said. 
-> One more thing to say about twill, when I ran the script (either
-> twill-sh or python) I always have a warning/message when I use go
-> ('http://url'), given the url is localhost or www.ebay.com : "The
-> process cannot access the file because it is being used by another
-> process" and it still ran to the end of the script just fine. 
-> Do you have any clue what it was?

You can try the 'config run_tidy 0' that I suggested to Alex...
otherwise not sure.  Sounds like I'll have to go find a Windows box and
install it for myself ;).

cheers,
--titus



More information about the twill mailing list