PythonOption settings. Was: Re: [mod_python] WSGI gateway for mod_python

Graham Dumpleton grahamd at dscpl.com.au
Thu Feb 9 17:07:39 EST 2006


Robert Brewer wrote ..
> Hi everyone,
> 
> I've reworked my modpython_gateway module, removing the dependency on wsgiref.
> If you'd like to include it in the standard MP distro, I'd be willing to
> release it under any free terms: public domain, MIT, other. Let me know
> what your licensing requirements are.
> 
> http://projects.amor.org/misc/wiki/ModPythonGateway
> 
> 
> Robert Brewer
> System Architect
> Amor Ministries
> fumanchu at amor.org

Haven't looked through the actual code yet, but a suggestion in regard
to how you name PythonOption variables. The web page mentions:

    PythonOption application cherrypy._cpwsgi::wsgiApp
    PythonOption import myapp.cherrypy::startapp

    PythonOption SCRIPT_NAME /myapp

In the interests of avoiding name clashes, I would very mush suggest
that option names being put in some sort of namespace. For example:

    PythonOption wsgi-gateway.application cherrypy._cpwsgi::wsgiApp
    PythonOption wsgi-gateway.import myapp.cherrypy::startapp

    PythonOption wsgi-gateway.SCRIPT_NAME /myapp

I haven't logged a JIRA entry yet about this, but I want to push that the
same thing be done for any cases where mod_python itself uses
PythonOption variables. For example:

    PythonOption mod_python.session_cookie_name ...
    PythonOption mod_python.ApplicationPath ...
    PythonOption mod_python.session_dbm ...
    PythonOption mod_python.session_fast_cleanup ...
    etc ....

If appropriate for mod_python, multiple levels of naming should be used.
For example, "session_fast_cleanup" is actually related to FileSession, so
perhaps it should be:

  PythonOption mod_python.Session.cookie_name ...
  PythonOption mod_python.Session.application_path ...
  PythonOption mod_python.DbmSession.database ...
  PythonOption mod_python.FileSession.fast_cleanup ...

Thus, class name is interjected as second level in name. Also would like
to see final attribute name settle on lower case with underscore between
distinct words.

We can support old names in mod_python for the time being but should
deprecate them.

Comments?


Graham


More information about the Mod_python mailing list