[Zope] Zope stability

Michel Pelletier michel@digicool.com
Wed, 8 Dec 1999 16:04:25 -0500


> -----Original Message-----
> From: LD Landis [mailto:ldl@LDL.HealthPartners.COM]
> Sent: Wednesday, December 08, 1999 3:14 PM
> To: michel@digicool.com
> Subject: Re: [Zope] Zope stability
> 
> 
> Michel,
>   
>   Not that you don't have anything else to do... but it would be real
>   handy to have a "tutorial" on how to use all of this stuff... If one
>   has been created... sorry, and TIA for the pointer!  (Also, 
> what's all
>   that stuff about the other ports that are being listened to as well?
>   isn't that a remote "control terminal" or some such)

What should happen is someone needs to expand on ken's how-to.  It's
like this, debugging is an art above and beyond the debugger, if you
don't know *how* to debug, no debuger, no matter how visual, will aid
you.

So really, what is needed is a doc that explains how to fire up into the
debugger, and that's easy.  If you're lost from there, you need to learn
how to debug (and how to use a command line debugger like pdb (which is
a lot like all other forms of command like debugger I've ever used).

This is how you get into the debugger.

Shut down your Zope.

Go to the lib/python directory

Run python:

[michel@korak python]$ python1.5.2
Python 1.5.2 (#1, Jul  5 1999, 14:47:37)  [GCC egcs-2.91.66
19990314/Linux (egcs- on linux2
Copyright 1991-1995 Stichting Mathematisch Centrum, Amsterdam

import Zope and ZPublisher

Py$ import ZPublisher, Zope

Now you can issue requests to Zope just like a web browser:

Py$ ZPublisher.Zope('index_html')

will call and return the 'index_html' object in the root folder.

You can enter the debugger with the d=1 argument:

Py$ ZPublisher.Zope('index_html', d=1)
* Type "s<cr>c<cr>" to jump to beginning of real publishing process.
* Then type c<cr> to jump to the beginning of the URL traversal
  algorithm.
* Then type c<cr> to jump to published object call.
> <string>(0)?()
pdb> 

This fires you into the python debugger, pdb. First off, hit 's' to step
into the debugger.

 For your convinience, two breakpoints are set for you.  Hit 'c' once to
continue to the first breakpoint, which is at the beginning of the URL
traversal to find your object.  I ususaly skip beyond this as it is
really only useful to look at the request before it traversed and to
debug ZPublisher.

Hit 'c' again to continue past the first breakpoint to the second, which
is rigt before the object you are looking for is called.  This is most
useful to debug application specific logic.

-Michel