[Framework-Team] PLIP #247 ready for review (I think)
Andreas Zeidler
az at zitc.de
Thu Feb 12 12:42:13 UTC 2009
On Feb 7, 2009, at 12:56 AM, Ethan Jucovy wrote:
> On Thu, Feb 5, 2009 at 3:37 PM, Andreas Zeidler <az at zitc.de> wrote:
>> On Feb 5, 2009, at 9:29 PM, Andreas Zeidler wrote:
>>> i noticed that. in fact, i was trying to figure out how the
>>> assigned value ("plone") ended up in `module_name`. i
>>> ended up looked at the entry point's (the one you get from
>>> `pkg_resources.iter_entry_points`) `__dict__`, assuming
>>> that some magic in `pkg_resources` would translate the "target" to
>>> be meant as the module's name. but apparently
>>> all given value end up as `module_name` in the dict. i suppose i
>>> should have had a closer look at entry point definitions first.
>
> Ah, yeah, a single entry point basically models a dictionary entry:
> `module_name` is (part of) the entry point's "value", which is
> imported as a Python object; `name` is the "key".
i was missing that info initially, but figured as much after a bit...
thanks for clarifying it again, though.
>>>> Perhaps z3c.autoinclude could check if
>>>> `os.environ.has_key('Z3C_AUTOINCLUDE_DISABLED')` and the test
>>>> runner and/or a buildout option could set that environment
>>>> variable?
>>>
>>> yep, also +1. after all, that's exactly what environment variable
>>> are for, aren't they? :)
>
> OK, z3c.autoinclude trunk as of r96193 checks for
> 'Z3C_AUTOINCLUDE_PLUGINS_DISABLED' and
> 'Z3C_AUTOINCLUDE_DEPENDENCIES_DISABLED' in the environment.
great. just one more tiny little suggestion: how about catching the
key error in the `enable_*` function, so people can use it
unconditionally (i.e. without consulting `dependencies_disabled` first)?
$ ./bin/zopepy
>>> from z3c.autoinclude.api import enable_dependencies
>>> enable_dependencies()
Traceback (most recent call last):
[...]
KeyError: 'Z3C_AUTOINCLUDE_PLUGINS_DISABLED'
> n/p, none of this has been too time-consuming yet :)
:)
thanks for the update, ethan. i'm changing my vote to +1.
cheers,
andi
--
zeidler it consulting - http://zitc.de/ - info at zitc.de
friedelstraße 31 - 12047 berlin - telefon +49 30 25563779
pgp key at http://zitc.de/pgp - http://wwwkeys.de.pgp.net/
plone 3.2.1 released! -- http://plone.org/products/plone/
-------------- next part --------------
A non-text attachment was scrubbed...
Name: PGP.sig
Type: application/pgp-signature
Size: 186 bytes
Desc: This is a digitally signed message part
URL: <http://lists.plone.org/pipermail/plone-framework-team/attachments/20090212/21a3f044/attachment.sig>
More information about the Framework-Team
mailing list