Graham Dumpleton
grahamd at dscpl.com.au
Tue May 9 01:22:34 EDT 2006
Dan Eloff wrote .. > 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. This discussion should perhaps be on the developers mailing list, here will do for the moment though. Now, before you contemplate making any code changes, just outline at a high level what options/directives you have in mind should be added and what defining them should cause to happen. In the mean time, I'll have to go back and read what I rambled on about last time as I forget. I don't think though that I revealed everything you could do and although some of the stuff I didn't mention may not be directly useful, it may well form basis of implementing such stuff. Will be interested to here how you think such global search paths should work. After all, you are probably the first to try and seriously use the new importer in the new ways that it can be used. Anyway, will see what you have to say and make comments if appropriate. Graham
|