There is no documentation. You guys put me to shame. ;-)
It's pretty simple, though. It is a shell, like IDLE or PythonWin, but not
an editor or full IDE. It also has a tree control of the current namespace.
So, for example, you can import a module in the shell and "inspect" its
contents in the tree. A selected node in the tree displays useful info for
the object, including the name, type, value and a display of the code it is
based on, if the object is a module, class, method, etc.
Taking Zope as an example, you can't access Zope in PyCrust (or any Python
shell, for that matter) while Zope is running. So first you have to stop the
Zope server. Then you just do:
>>> import sys
>>> sys.path.insert(1, 'C:\\Zope\\lib\\python')
>>> import Zope
>>> app = Zope.app()
The app object is the root of the Zope database. From here you can get to
everything. The easiest way is to drill down into stuff in the namespace
viewer. In the PyCrust shell you can interact with Zope and call Zope
methods, much like you would through the web interface. (Or, perhaps, much
like the web interface is doing behind the scenes.)
I don't know enough about Webware to know whether the same is possible. And
I haven't seen you guys talk about doing Webware stuff directly from a
Python shell interface. But if there is a way to do that, then PyCrust gets
you additional things like: colorized code, command completion (dynamically
generated popup list of valid attributes when you type a dot), call tips
(the arguments and docstring display in a balloon when you type a left
paren), command history (like IDLE and PythonWin), multiline command editing
There are a couple of pictures of the namespace viewer and shell here:
So, is there a way to interface with Webware from a Python shell?
Patrick K. O'Brien
> -----Original Message-----
> From: webware-discuss-admin@...
> [mailto:webware-discuss-admin@... Behalf Of Edmund
> Sent: Thursday, February 21, 2002 7:52 PM
> To: pobrien@...
> Cc: Luke Opperman; Webware Discuss
> Subject: RE: [Webware-discuss] Tools for introspection
> >>Have you looked at PyCrust?<<
> No, this is new to me... Just went to the link. Are there docs anywhere?
> >>I haven't tried to use it with Webware, but I'd be willing to work on it
> if someone could help with
> the Webware side of things.<<
> I don't know enough to help here. Perhaps someone else can jump in and
> comment on the feasibility of this?
> Webware-discuss mailing list