Probably best to err on the side of caution. I don't mind the way it
works now, and I'd rather have that than an unpredictable bug that
takes frustrating hour upon hour to solve.

-Dan

On 5/11/06, Graham Dumpleton <[EMAIL PROTECTED]> wrote:

On 12/05/2006, at 3:52 AM, Dan Eloff wrote:

> 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.

Don't propagate it down by default through either apache.import_module()
or "import" due to concerns arising from fact module could be imported
through two different routes and the inherited search path could be
different
through each route. Thus, the unpredictability that could arise if
such a
thing occurred. Overall, just being cautious until got feedback on how
people think it should work.

Graham

Reply via email to