[mod_python] Graham's New Importer

Dan Eloff dan.eloff at gmail.com
Tue May 9 00:58:17 EDT 2006

Hey Graham, I've been using your new module importer and it works like
a charm. I haven't had a single problem with it. Thanks!

I would like to discuss having a general search path, and being able
to add directories to it. While I understand the reasons you have (and
they are valid, good reasons) for not wanting to do this, there are
also good reasons to have the ability. Right now, so I don't have to
stick the absolute path to pyserver components in every file, I've
moved pyserver to site-packages, giving up the reload ability. It also
prevents me from using the debugger without restarting the server. I
also find that I have some common includes off sys.path and I've sunk
to placing the absolute path in an extraneous module and importing
that whenever I need to import these common files so as to avoid
sticking the path everywhere. It's less than ideal. I think it would
really be a nice touch to be able to choose which behaviour you want.
Just add a PythonOption called search_path or import_path or
something, and if given the directories listed get added to the search
path for all importing needs.

If you're not interested I'll add this, but I would want your
permission first before I go messing with your code.

That aside, don't let my suggestion for improvement detract in any way
from your importer, it's really a great piece of work.

More information about the Mod_python mailing list