At 10:54 2002-08-15 +0100, Chris Withers wrote:
>Johan Carlsson [Torped] wrote:
>>I'm trying to setup to run with either TextPad, which can run external 
>>program like python scripts
>>and then parse the result and making Traceback lines linked to the 
>>line/file where the error occurred.
>No sure exactly what you're trying to do here, can you privde more detail?

Well, I solved "the problem" another way, when I realized that I could parse
the Stupid Log File and make traceback's clickable in that file:

I added a small python script that only gives me the latest stuff in the SLF,
and it works quite nice. Now when I get an error I just press CTRL-1 inside
Textpad and I get the traceback, click on the error rows and it will 
open the correct file and scroll to the row where the error occured.

For anyone using TextPad on Windows this should quite a time saver.
(I know that I forgot to implement a check for if the SLF has been reseted,
something my Zope start-up script does everytime I restart the server.

It's almost like having a RAD tool for Zope. Well not really, but it's an 

It should also be possible to make a small script that takes a input file
with REQUEST information and then make the HTTP request to the development 
and return any traceback messages from the reply to TextPad.
(SLF only shows error messages when a product is refreshed, this way it 
should be
possible to retrieve traceback from the running code.

(Interactive debugging has to wait, but in Windows it would be terrific to 
use PythonWin
for the task. But starting Zope from within PythonWin usually has the effect of
PythonWin hangling. I might be because I have a really slow laptop :-)

>>Or try using Python which has an build in debugger which I like to be 
>>able to use.
>>The first problem I encounter in both scenarios is that when a file 
>>"import Globals"
>>which in its turn "from Persistence import Persistent", this fails.
>>Mostly because Persistence is "hot patched" by ZODB.
>>Is there any smart way to setup a "virtual Zope" environment without 
>>importing Zope
>>(which mounts the Data.fs) or by importing Zope by in a light way without 
>>a storage or just mounting a lights storage.
>'import Zope' is the only sane thing I can think you'd want to do. Zope 
>has lots of magic that happens when you do that, and unless you do that, 
>things won't behave as you expect.
>You will need to mount the ZODB, but if you use ZEO then this isn't a 
>problem as your webserver can mount the same storage.

I think I have a look at how unit test does this, when I have the time. It 
would probably solve my problems.
Running UnitTest from within TextPad or PythonWin would be a nice way to 
develop thing in.
(Unfortunately I'm not up in speed with writing UnitTests)



Torped Strategi och Kommunikation AB
Johan Carlsson

Birkagatan 9
SE-113 36  Stockholm

Västmannagatan 67, Stockholm, Sweden

Phone +46-(0)8-32 31 23
Fax +46-(0)8-32 31 83
Mobil +46-(0)70-558 25 24

Zope-Dev maillist  -  [EMAIL PROTECTED]
**  No cross posts or HTML encoding!  **
(Related lists - )

Reply via email to