On Saturday, August 10, 2002, at 05:25  PM, Jason Hildebrand wrote:

> I explicitly add ~/projects/App/Lib to my PYTHONPATH when launching the
> appserver, which lets me import my "support" modules like so:
>
> import myutils   (imports Lib/myutils.py)
> from Middle.Shop import Shop (imports Shop from Lib/Middle/Shop.py)
>
> Hope this helps,
> Jason

Thanks for the suggestions. I had been using os.path.abspath(os.pardir), 
but after some testing I realized it was not adding the path that it 
should be. It was ignoring the last several levels. What made this hard 
to track down was that the correct path was displayed whenever I worked 
from the terminal. Worse, my servlet was able to correctly import 
because due to the file system layout, the package and module were in 
the same level, so it didn't need to search the folders listed in the 
PYTHONPATH. However, when control passed to MiddleKit, which is located 
in a separate folder, it looked for the package and was unable to locate 
it.

I'm still not sure what caused this.  I'm going to read up on the 
os.path methods and make sure they work the way I thought they do. For 
now I've set up my system to add the full path to my Middle folder when 
the AppServer starts up.  I've done some basic tests and everything 
imports correctly now, so I should be ready to start working on my 
servlets.

Thanks again,
Tim



-------------------------------------------------------
This sf.net email is sponsored by:ThinkGeek
Welcome to geek heaven.
http://thinkgeek.com/sf
_______________________________________________
Webware-discuss mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/webware-discuss

Reply via email to