[Zope] Method invocation.

Dieter Maurer dieter@handshake.de
Fri, 2 Mar 2001 21:21:30 +0100 (CET)


Antonio Costa writes:
 > This is a multi-part message in MIME format.
 > --------------5F89E75E2438473D186DD465
 > Content-Type: text/plain; charset=us-ascii
 > Content-Transfer-Encoding: 7bit
Please do not post MIME messages!

 > What I think I know is the following:
 > 1: The method called by Zopen when it creates an object/product is
 > declared at the file named __init__.py at that products directory.
Zope imports the "__init__" and then calls its function
"initialize" (if it is there).

 > My problem is:
 > 2: The problem I'm having several times is that from that method I'm
 > having trouble to call another one, if this other is a DTMLFile().
 >    I have no problem calling another method defined by def.
What happens? What trouble do you have?

 > What I don't know:
 > How to debug a situation like this. I'm having another problem with
 > method invocation a little bit like this and I can't debug it. I think
 > my problem has to do with the environment but I'm not sure and I don't
 > know how to figure it out.
There is the "ZPublisher/Test.py" script.
I use it regularly together with "pdb" (the Python debugger)
to analyse complex problems.
It allows you to emulate HTTP request from the command line
and to debug the execution with "pdb".

Initialization problems often do not need real debugging.
  Many problems in this phase lead to a broken product.
  In this case, the corresponding product in "Control_Panel->Product Management"
  has a traceback object that shows where the problem occured.

  For unknown reasons, some problems in this phase show not
  up in a broken product (the product is left unchanged but
  is not working). Many of these can be analysed (and solved)
  by enabling Zope's logging facility:
  define STUPID_LOG_FILE as a filename (argument to "start").
  Such problems are then logged to the log file and can be
  analysed.



Dieter