Re: PythonImport that works for any interpreter.

2006-03-29 Thread Jim Gallacher

Graham Dumpleton wrote:

In:

  http://issues.apache.org/jira/browse/MODPYTHON-117

I describe the idea of having a means of using PythonImport to define a
module to be imported into any interpreter that may be created. For some
cases where there are a lot of virtual hosts, this may be simpler than
having to list a directive for every virtual host explicitly.

Is there any interest in such a feature?

If of interest, for a simple implementation, the only issue is one of
ordering when for an interpreter there are both imports for all
interpreters and an interpreter specific imports. Does one import the
module specified to be imported in all interpreters first before the
interpreter specific ones or vice versa.

My feeling has been that the modules to be imported in all intrepreters
should be done first.

Feedback?

Am I wasting my time implementing this one?


That's entirely up to you. It's not a feature that I need, so don't do 
it on my account. ;)


Jim



PythonImport that works for any interpreter.

2006-03-28 Thread Graham Dumpleton
In:

  http://issues.apache.org/jira/browse/MODPYTHON-117

I describe the idea of having a means of using PythonImport to define a
module to be imported into any interpreter that may be created. For some
cases where there are a lot of virtual hosts, this may be simpler than
having to list a directive for every virtual host explicitly.

Is there any interest in such a feature?

If of interest, for a simple implementation, the only issue is one of
ordering when for an interpreter there are both imports for all
interpreters and an interpreter specific imports. Does one import the
module specified to be imported in all interpreters first before the
interpreter specific ones or vice versa.

My feeling has been that the modules to be imported in all intrepreters
should be done first.

Feedback?

Am I wasting my time implementing this one?

Graham


[jira] Work stopped: (MODPYTHON-117) PythonImport that works for any interpreter.

2006-03-16 Thread Graham Dumpleton (JIRA)
 [ http://issues.apache.org/jira/browse/MODPYTHON-117?page=all ]

Work on MODPYTHON-117 stopped by Graham Dumpleton

 PythonImport that works for any interpreter.
 

  Key: MODPYTHON-117
  URL: http://issues.apache.org/jira/browse/MODPYTHON-117
  Project: mod_python
 Type: Wish
   Components: core
 Versions: 3.2.7
 Reporter: Graham Dumpleton
 Assignee: Graham Dumpleton


 Currently PythonImport requires that the name of the interpreter be 
 explicitly named. If running lots of virtual hosts, where each is dynamically 
 assigned their own interpreter name automatically, it is a lot of work to 
 have to specify PythonImport directives for all virtual host interpreters 
 where a particular module needs to be loaded in all interpreters.
 Syntactically, it isn't hard to allow something like:
   PythonImport moduleforallinterpreters
 or:
   PythonImport moduleforallinterpreters *
 however the current location where such Python imports are done in mod_python 
 will not allow this.
 This is because such Python imports are done in the PythonChildInitHandler() 
 function right after the child process is initialised. The code iterates 
 through the list of imports and creates interpreters for the named 
 interpreters and loads the modules. Where we want a module loaded into all 
 modules, we will not actually know the names of all potential modules in 
 advance at that point so can't do it.
 The logical spot is to to load a module common to all modules in 
 get_interpreter() when a request is first made for the interpreter. Thus, it 
 may be possible to move the module imports from PythonChildInitHandler() into 
 get_interpreter().
 One issue that needs to be considered is that currently, having a 
 PythonImport directive means that any named interpreter is always created at 
 child initialisation, even if a request never arrives that is processed 
 within the context of that interpreter. It might also be worthwhile adding 
 syntax which allows one to specify whether a PythonImport should be performed 
 at the point of child initialisation, or only when a request comes in that 
 requires that specific interpreter. To keep backward compatability, the 
 default would be at child initialisation time.
 Not sure what would be a good syntax. The options would be 'child 
 intialisation' and 'interpreter initialisation'. How to express that

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
   http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see:
   http://www.atlassian.com/software/jira