On 5/10/06, Graham Dumpleton <[EMAIL PROTECTED]> wrote:
Dan Eloff wrote ..
> > This may turn out to be messy or not useful as is as well. Overall, I
> > guess what we need to come up with is some example use cases where
> > search paths are required and perhaps work from that as to what is
> > a good interface for supporting it. At the moment, my impression is
> > that the common use case is in order to access some configuration
> > module in a central location. Can you describe again your use case?
>
> pyserver is a supporting framework for my websites, it handles
> cookies, sessions (including a very secure two-tier session), database
> connections (pooling & automatic rollback on exception), form
> validation and error handling, templates, etc. So most of my modules
> import at least one module from pyserver. I constantly am fiddling
> with pyserver so the ability to autoreload and debug it is very nice.
> I also have modules containing common functionality like login/logout
> functions, email functions, and misc stuff that I like to access all
> over the place. I want these things to autoreload, but I also want
> them available from anywhere.

How does the need for a search path come into this? Is it these common
modules you mention in the last couple of sentences that are located
in some other location, which you want found by a path search but want
to be reloadable rather than being on sys.path?

They are part of it, but there's only a few of them. There's a dozen
pyserver modules, and all of them have to be importable from any
module anywhere in my site, including those common modules. Currently
this is where I'm having trouble with using the import path as you
suggested. The website modules are being imported fine, they are using
the import path and finding both pyserver and the common modules.
However the the import path only works for modules one level deep, it
doesn't carry over so the common modules don't find pyserver. That's
easy enough to fix by using apache.import_module in the common
modules. I'm curious why you didn't let the import path propogate down
the import tree though.

-Dan

Reply via email to