-----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 )
At 7:28 PM -0400 5/24/99, Michel Pelletier wrote:
-----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.
Thanks very much, this is exactly what I was looking for.
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?
I have an existing module that I want to publish, and have done so at a URL like http://www.domain.com/dir/site.cgi. The root object has methods named index_cgi, form_cgi, accept_cgi, etc. These methods return HTML expecting relative references to access the filesystem. So if I access the module from a URL like http://www.domain.com/dir/site.cgi/index_cgi, then my images are all broken. If possible I would like to be able to make an index.cgi that acts like site.cgi/index_cgi, a form.cgi that acts like site.cgi/form_cgi, etc. -Tony ---------------- Tony Lownds tony@printra.net
participants (2)
-
Michel Pelletier -
Tony Lownds