On Fri, Mar 02, 2007 at 12:31:22PM -0500, Giovannetti, Mark wrote: > Thanks for confirming some of my questions! Is there a book > that you would recommend that explains how python deals with > all this?
I liked Mark Pilgrim's _Dive into Python_. I don't remember if it goes into details about how Python modules work. > > In fact, this is how Python imports modules: it executes the > > .py file of the module. (It does this at most once during the > > program's execution, unless you explicitly ask it to reload > > modules. Zope 3 never asks.) > > Great, now I think I have a good handle on what is going on. This > also explains why I have to restart zope when I make code changes > (something that puzzled me very briefly when I started learning). > > So if I wanted to register utilities without using ZCML, I could > place the provideUtility(...) calls in an __init__.py or directly > within the utility's .py module. Yes? Yes, but only if you could make sure that your package or module was imported during Zope 3 startup. Grok uses a similar scheme, as far as I understand: you declare your adapters and utilites in Python code, and then a single ZCML directive in the grok: namespace loads your package and registers everything. Does Grok have a website? Google doesn't give me anything more useful than these blog posts: http://faassen.n--tree.net/blog/view/weblog/2006/11/09/0 http://faassen.n--tree.net/blog/view/weblog/2007/01/09/0 http://www.z3lab.org/sections/blogs/philipp-weitershausen/2007_01_09_you-thought-zope-3-wasn Marius Gedminas -- The laser etcher can accept most any image data, (think logos or screen dumps!) and render it on a heat-sensitive surface. There's a big tunable exhaust fan, so the thing can be dialed in to Not vaporize your laptop. -- Stuart Kreitman
signature.asc
Description: Digital signature
_______________________________________________ Zope3-users mailing list Zope3-users@zope.org http://mail.zope.org/mailman/listinfo/zope3-users