[Zope-dev] Is Zope.2.7.4 feature frozen ?

Rodrigo Dias Arruda Senra rodsenra at gpr.com.br
Thu Dec 16 12:54:28 EST 2004


Paul Winkler wrote:

>On Thu, Sep 16, 2004 at 11:16:22AM -0300, Rodrigo Dias Arruda Senra wrote:
>  
>
>>Hi,
>>
>>is the  Zope 2.7.4 feature frozen ?
>>
>>If not, I believe that the patch :
>>   http://zope.org/Collectors/Zope/1584
>>   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 Extensions.py, 
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.
 
cheers,
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 @@
     <metadefault>$instancehome/Products</metadefault>
   </multikey>
 
+
+  <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">
     <description>
       This specifies additional paths directories which are inserted into
Index: lib/python/App/Extensions.py
===================================================================
--- lib/python/App/Extensions.py    (revision 28473)
+++ lib/python/App/Extensions.py    (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)





More information about the Zope-Dev mailing list