ZOPE Python edit debug cycle

Phlip no at spam.com
Tue Aug 29 09:55:55 EDT 2000


Answer summary here: No further questions.

"Darrell Gallion" <darrell at dorb.com> wrote in message
news:008f01c01156$f73acf20$6401a8c0 at home...

> Don't run Zope as a service for development.
> Run with -D and give extensions a try. Those are .py files in the
Extensions
> directory. With -D the .py seems to be reloaded as needed.

!

> Once you have some code working move up to a product. Which as far as I
know
> requires Zope to shutdown and restart.

Ouch. I'm editing an existing Product.

If it had come with UnitTests, my inner development loop could edit those to
alter the behavior, then my outer loop would stop and restart the service to
see the change in the resulting Product.

"Skip Montanaro" <skip at mojam.com> wrote in message
news:14762.51853.701171.671725 at beluga.mojam.com...
>
>     Phlip> If I had a syntax error, ZOPE throws it away and I never get to
>     Phlip> read it.
>
> Not sure about your other problems, but Zope generally buries a Python
> traceback in an HTML comment when it detects an error.  Try viewing the
> source of the output.

Site users would never think to look there!

"Duncan Booth" <duncan at rcp.co.uk> wrote in message
news:8F9F78D0Eduncanrcpcouk at 194.238.50.13...

> >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?

> 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.

"Martijn Faassen" <m.faassen at vet.uu.nl> wrote in message
news:8og44d$h46$1 at newshost.accu.uu.nl...

> You can see it on the products screen, generally. Though perhaps not
> for syntax errors; not sure. But you can always check for those by
> trying to run the .py file manually.

My experience was if ZOPE detected a syntax error in my edits, it would
brand all the Product's ZObjects as "damaged" and refuse to have anything to
do with them.

> That said, there are various options to shorten the cycle:
>
>   * use ZClasses (possibly with through the web Python methods or
>     external methods). Editing these has instantaneous results.
>
>   * use the experimental product refresh product:
>
>     http://www.zope.org/Members/hathawsh/Refresh
>
>     I've noticed some odd glitches with this, but overall it does seem
>     to work. It allows you to refresh products in a running Zope.

Righteous.

I promise this group I'l take future ZOPE questions to the ZOPE list!

--
 Phlip
======= http://users.deltanet.com/~tegan/home.html =======





More information about the Python-list mailing list