Paul Winkler wrote:

On Thu, Sep 16, 2004 at 11:16:22AM -0300, Rodrigo Dias Arruda Senra wrote:


is the  Zope 2.7.4 feature frozen ?

If not, I believe that the patch :
It adds the directive 'extensions' to zope.conf.
If overriden, then the specified directory will be used for ExternalMethods,
instead of the default $INSTANCE/Extensions.

Nice idea. How hard would it be to make it support multiple Extensions directories, just like we can have
multiple Products directories?

Fortunately it is was not hard at all, it took me one hour to find where to tweak, do it and test it under 2.8.
And it took *that long* because it was my first excursion under Zope skirts ;o)

Namely, it required three small additions to, zopeschema.xml, and zope.conf.
You can see details below, but that version was coded against 2.8 cvs snapshot.

I believe it will remain mostly the same against 2.7.5, but is better to be safe than sorry.
So I'll test it and re-submit to collector as Andreas suggested previously in this thread,
but this time I'll give it a higher priority since it seems to be useful and easy to add.

Rod Senra

Index: lib/python/Zope/Startup/zopeschema.xml
--- lib/python/Zope/Startup/zopeschema.xml    (revision 28473)
+++ lib/python/Zope/Startup/zopeschema.xml    (working copy)
@@ -332,6 +332,14 @@

+ <key name="extensions" datatype="existing-directory">
+ <description>
+ This overrides the path to the Extensions directory.
+ </description>
+ <metadefault>$instancehome/Extensions</metadefault>
+ </key>
+ <multikey name="path" datatype="string">
This specifies additional paths directories which are inserted into
Index: lib/python/App/
--- lib/python/App/ (revision 28473)
+++ lib/python/App/ (working copy)
@@ -87,8 +87,14 @@
r = _getPath(product_dir, os.path.join(p, prefix), n, suffixes)
if r is not None: return r

+ import App.config
cfg = App.config.getConfiguration()
+ if (prefix=="Extensions") and (cfg.extensions is not None):
+ r=_getPath(cfg.extensions, '', name, suffixes)
+ if r is not None: return r
+ sw=os.path.dirname(os.path.dirname(cfg.softwarehome))
for home in (cfg.instancehome, sw):
r=_getPath(home, prefix, name, suffixes)

Zope-Dev maillist - [EMAIL PROTECTED]
** No cross posts or HTML encoding! **
(Related lists - )

Reply via email to