Newbie question: Directory for publishing Python modules?
I'm an olden-days Bobo user who's looking at maybe using Zope for a research project. I downloaded the latest sources, read the faqs, the discussion list archives, the WebSite, the online documentation etc. I have been tracing through the modules call by call trying to figure out this simple question for about 5 hours now. It seems that there's an assumption I'm missing, and some piece of magic I have not yet found: What path is used to determine the list of callable modules under Zope + ZServer? It isn't the Pythonpath returned from the medusa monitor (thank-goodness, that has every python source tree on my computer). It doesn't _appear_ to be anything inside the Zope directory tree (I don't see anything that would make sense as a root publishing directory). When I debug-print the code, I find that publish_module doesn't seem to get called for the modules I'm passing as arguments (though "Zope" does get passed). More prosaically: Where do I put my python modules to get them published in the root namespace? With the old Bobo, I was just putting the modules in my web-server's cgi-bin directory (with a wrapper). Nothing in the documentation suggests where the equivalent directory would be for Zope. I've already figured out how to replace the XML RPC with a high-performance multiple-query binary connection (which I had thought was going to be most of the work this evening, but took only about 10 minutes), but this ridiculously simple task has stopped me cold. Well, hints appreciated, I would rather not have to write my own object database, access control managers etc. because of such a silly problem. Mike ______________________________________ M i k e C . F l e t c h e r mcfletch@vrtelecom.com Designer, Researcher
Such a search path is not present in this simple form. If you want to use a function in a module you need to put the module into a directory named 'Extensions' in the Zope-Root directory. Then go to the manage page of your zope site at the appropriate folder and add an 'External method'. In this form you are asked for the module and function name. You can then call your method with the id you gave in this form. This method is actually called as a method of the folder from which it's called. To integrate the method with zope more closely you can give self as the first argument. self is than the folder instance. (Not mentioning dtml-documents, which can also have methods, I think, but not tried) HTH and is not erroneous, __Janko
participants (2)
-
jhauser@ifm.uni-kiel.de -
Mike Fletcher