[Zope] dir in Extensions
John Hunter
jdhunter@ace.bsd.uchicago.edu
Tue, 05 Feb 2002 10:14:27 -0600
>>>>> "Thomas" == Thomas B Passin <tpassin@mitretek.org> writes:
Thomas> [Tim Hicks]
>> > Is it possible to create subdirectories of Zope/Extensions/
>> and use > the dir.file syntax to access their contents?
>>
>> As far as I remember, it is not possible to import modules from
>> the Extensions directory (or any of its children I presume).
>> You need to put the modules somewhere else appropriate. I use
>> lib/python/Shared/<My
Thomas> Chosen
>> Folder Name>/module.py
>>
Thomas> You do have to make sure they are on the python path used
Thomas> by your zope python interpreter. One way is to put the
Thomas> location into a .pth file. This has come up a few times
Thomas> on the list.
I am still having trouble; perhaps someone can advise.
/usr/local/Zope is my Zope install
/usr/local/lib/python is the python dir used by Zope
I put the directory ' SomeDir' and its contents in
/usr/local/Zope/lib/python/Shared/.. I put SomeDir.pth in
/usr/local/lib/python/site-packages/ and it has a single line which
reads:
/usr/local/Zope/lib/python/Shared
As root (same shell that I use to start Zope), I can in a python shell
>>> import SomeDir.SomeFile
I restarted zope and reloaded my web browser. I created an external
method in zope and use the module name SomeDir.SomeFile where
SomeFile.py resides in /usr/local/Zope/lib/python/Shared/SomeDir/, but
I still get the Zope error:
The specified module, SomeDir.SomeFile, couldn't be found
What am I doing wrong?
Thanks,
John Hunter