ZOPE Python edit debug cycle

Duncan Booth duncan at rcp.co.uk
Tue Aug 29 06:55:28 EDT 2000


phlip_cpp at my-deja.com (Phlip) wrote in <8oefpc$ve8$1 at nnrp1.deja.com>:

>Newsgroupies.
>
>I installed ZOPE on Win32, and noticed it came with a bunch of
>"Products"; each a kind of "soft driver" written in some language
>(typically Python) to drive the ZObject space & build Web pages.
>
>Then I tried to edit a py file and see the new output. I had to use
>this sequence to see my tiny change:
>
>    make the change
>    save the change
>    Stop the ZOPE service
>    Start the ZOPE service
>    Refresh the ZOPE Web page
>    Inspect the change.
>
>If I had a syntax error, ZOPE throws it away and I never get to read
>it.
Drill down through the control panel to the Products folder. If you had a 
syntax error your product will be marked as a broken product and there will 
be a traceback tab on the management screen with the details.

If you set the paths up correctly you should also be able to check for 
syntax errors by running python directly on your product sources.

>
>The inner question: How, in ZOPE land, do you ask it to refresh its
>concepts of all the Python files without stopping and restarting the
>service?
There is a product somewhere that reloads products without requiring a 
restart of Zope.

What I usually do is to develop products on a copy of Zope that is not 
running as a service. That way the restart cycle is minimised, and you can 
also put print statements into your code to see what is happening.




More information about the Python-list mailing list