[Zope-dev] Re: [Zope] Re: Give 'Extensions' a configurable
directory in zope.conf
Florent Guillaume
fg at nuxeo.com
Fri Nov 19 06:20:16 EST 2004
> * /lib/python/Products/ExternalMethod/ExternalMethod.py
>
> - little typos (not related, but since I was there <wink>)
It's a good practice to fix typos and such in a separate patch/checkin,
so that those reading the diffs or patches can concentrate on what's
really done.
> * /lib/python/App/Extensions.py
>
> - in getPath() check if directive 'extensions' is overriden in zope.conf,
> and use it instead.
>
> The relevant code added to getPath() is depicted below.
>
> <code>
> if (prefix=="Extensions") and (cfg.extensions is not None):
> r=_getPath(cfg.extensions, '', name, suffixes)
> if r is not None: return r
> </code>
It's also nice to use modern python coding style (even when copy/pasting
code):
if prefix == "Extensions" and cfg.extensions is not None:
r = _getPath(cfg.extensions, '', name, suffixes)
if r is not None:
return r
> However, I did not understood the purpose of the construction
> "if r is not None: return r".
>
> That was the last statement in getPath(). If r==None then getPath()
> wouldn't return None all the same ?
It's in a loop. The first working path is returned.
> I believe this is the last bit of doubt before submitting the patch.
>
> BTW, maybe I should have posted this to Zope-Dev instead ?
Yep :) I Cc zope-dev, and followup there.
But now that you put it in the collector it's ok. Thanks for the patch.
Florent
--
Florent Guillaume, Nuxeo (Paris, France) CTO, Director of R&D
+33 1 40 33 71 59 http://nuxeo.com fg at nuxeo.com
More information about the Zope-Dev
mailing list