[Zope-CMF] Re: SVN: CMF/branches/tseaver-pkg_resources/ Avoid using __file__ where possible.

Tres Seaver tseaver at palladion.com
Fri Nov 11 11:26:06 EST 2005


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Chris Withers wrote:
> Tres Seaver wrote:
> 
>> Log message for revision 40036:
>>   Avoid using __file__ where possible.
> 
> 
> Why? I use this all over the place so need to know why it's bad ;-)

The branch that checkin landed on is the one where I am trying to make
CMF trunk distributable as an egg.  Products which want to be
distributed as eggs need to avoid using __file__ directly, and instead
rely on the 'pkg_resource' APIs supplied with Phillip Eby's setuptools
(this makes them "zip_safe").

CMF isn't quite there yet:

  - Some of the tests play with __file__ in ways that are painful
    to reproduce, and I haven't gotten there yet.

  - The GenericSetup profile mechanism doesn't yet grok eggified
    products.

OTOH, the skins mechanism (on that branch) now works beautifully from
an eggified CMF.

Tres.
- --
===================================================================
Tres Seaver          +1 202-558-7113          tseaver at palladion.com
Palladion Software   "Excellence by Design"    http://palladion.com
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.1 (GNU/Linux)
Comment: Using GnuPG with Thunderbird - http://enigmail.mozdev.org

iD8DBQFDdMYd+gerLs4ltQ4RAnsPAKDRk1/w3TdHnYsUxjC3EOcaKTV5AgCgtr3o
qj8wmpLxv3hT6mOlTvjsmsQ=
=gtoc
-----END PGP SIGNATURE-----



More information about the Zope-CMF mailing list