[Zope] frustrated by inability to introspect...
Holger Blasum
holger@blasum.net
Mon, 28 Oct 2002 05:59:26 +0100
On Sat, Oct 26, 2002 at 01:02:06AM -0400, Chris McDonough wrote:
> You may be interested in this, however if you want to just bust down
> into a Python prompt and call methods and whatnot:
>
> http://www.zope.org/Members/michel/HowTos/TheDebuggerIsYourFriend
> http://www.zope.org/Members/mcdonc/HowTos/UsingTheZopeDebugger
Good, let's try an interactive introspection session:
python
$ import Zope
$ app = Zope.app()
$ dir(app.standard_html_header)
[]
$ dir(app.standard_html_header)
['__name__', '_vars', 'globals', 'raw', 'title']
$ app.standard_html_header.manage_edit
<Python Method object at 0x85a8c60>
Well, I chose manage_edit because I knew *beforehand* that it exists,
but how do I find out *which other methods are available* at this step
(for e.g. app.standard_html_header).
http://www.zope.org/Documentation/Books/ZDG/current/TestingAndDebugging.stx
has the comment:
"Of course it won't show you acquired methods and attributes, but
that's what aq_parent and such are for. -- chrism"
Some more detail at this step would be very much appreciated - simply a
"$ dir(app.standard_html_header.aq_parent)" will not show manage_edit
either.
> On Fri, 2002-10-25 at 23:54, Skip Montanaro wrote:
> > ... and have so far been unable to find the attributes associated with
> > the "item" object. Where should I be looking? Is there a rough Zope
> > equivalent to
> >
> > >>> dir("abc")
> > ['__add__', '__class__', '__contains__', '__delattr__', '__doc__',
--
Holger