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

Dieter Maurer dieter at handshake.de
Fri Nov 11 14:36:06 EST 2005


Chris Withers wrote at 2005-11-11 09:05 +0000:
>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 ;-)

Back in April, I implemented for our local Zope version
to be run from a Zip archive (which lets Zope start significantly faster).

As you probably understand, I had to touch all these "__file__" references
because they point inside the ZIP archive.
It would have been much easier, had all places instead used
"from App.Common import package_home; home = package_home(globals())".
That, what I transformed "dirname(__file__)" references to.



-- 
Dieter


More information about the Zope-CMF mailing list