[Zope] Zope questions?

Michel Pelletier michel@digicool.com
Mon, 24 May 1999 19:28:45 -0400


> -----Original Message-----
> From: Tony Lownds [mailto:tony@metanet.com]
> Sent: Monday, May 24, 1999 7:15 PM
> To: zope@zope.org
> Subject: [Zope] Zope questions?
> 
> 
> I remember seeing a utility to get zope objects from the 
> command line -
> what archive is that in now?

lib/python/ZPublisher/Client.py is an HTTP based Zope RPC mechanism.

Quothe the usage information:

"""
Usage: %s [-u username:password] url [name=value ...]

where url is the web resource to call.

The -u option may be used to provide a user name and password.

Optional arguments may be provides as name=value pairs.

In a name value pair, if a name ends in ":file", then the value is
treated as a file name and the file is send using the file-upload
protocol.   If the file name is "-", then data are taken from standard
input.

The body of the response is written to standard output.
The headers of the response are written to standard error.
"""

You can also call things from python:

[michel@aldous python]$ python1.5.1
Python 1.5.1 (#2, Jan 26 1999, 10:47:10)  [GCC 2.7.2.3] on linux2
Copyright 1991-1995 Stichting Mathematisch Centrum, Amsterdam
>>> import Main, ZPublisher
>>> ZPublisher.Main('')
Status: 200 OK
X-Powered-By: Zope (www.zope.org), Python (www.python.org)
Content-Length: 35
Content-Type: text/plain

<Application instance at 0x811a0f8>
____________________________________________________________

>>> 

This is essentially asking for the 'index_html' method of the root
folder (like http://host.com/)  Since I dont have an index_html method,
it's give the str representation of root object, which is an object of
type 'Application'.

You can also specify more arguments to Main(): "u='userid:passwd'" as
the userid and password (for Basic auth, doesn't work for cookies,
that's a bit of a bugger). and "d=1" for real time debugging, or "pm=1"
for post mortem debugging.

> 
> Also, with ZPublisher, is it possible to publish methods of an object
> without having PATH_INFO stuff set, based on different pcgi 
> info files? Ie,
> http://www.domain.com/dir/index.cgi should publish
> mymodule.myobject.index_cgi,
> http://www.domain.com/dir/form.cgi should publish
> mymodule.myobject.form_cgi, etc.
> 

Uhm.  I don't quite get your question.  Clarification?

-Michel

> Thanks,
> 
> -Tony
> 
> 
> ----------------
> Tony Lownds
> tony@printra.net
> 
> 
> 
> _______________________________________________
> Zope maillist  -  Zope@zope.org
> http://www.zope.org/mailman/listinfo/zope
> 
> (For developer-specific issues, use the companion list,
> zope-dev@zope.org - http://www.zope.org/mailman/listinfo/zope-dev )
>