[mod_python] 3.X equivalent of 2.X req.get_dirs()

Graham Dumpleton grahamd at dscpl.com.au
Thu Oct 7 00:26:08 EDT 2004


On Oct 06 23:04, Graham Dumpleton <grahamd at dscpl.com.au> wrote:
>
> Subject: [mod_python] 3.X equivalent of 2.X req.get_dirs()
>
> Todays hard question. :-)
> 
> Is there an equivalent in mod_python 3.X to the req.get_dirs() method
> that appears in mod_python 2.X? Ie., in 2.X it would for example return:
> 
> {'PythonHandler': '/usr/local/etc/httpd/htdocs/projects/vampire/',
>  'PythonDebug': '/usr/local/etc/httpd/htdocs/projects/vampire/'}
> 
> That is, the directory in the hierarchy where the Apache directives such
> as PythonHandler were defined.
> 
> Previously I asked about a way to more or less determine exactly this.
> That is, the directory in the hierarchy where PythonHandler was defined
> for the currently active content handler.

Ahhh, not five minutes after I send this email, having sat on the email
for most of the day, I found what I wanted. One can use req.hlist to get
the name of the directory where the handler is defined. It doesn't seem to
be documented as a user type feature, but returns something like:

  {'handler:'vampire','directory':'/Users/grahamd/Sites/vampire/','silent':1}

It is the value for "directory" that I want.

How about a future version of mod_python formalising a sanctioned way
of users getting access to information about handlers and the directory
level they were defined at?

No to see if this really solves my problem. :-)

--
Graham Dumpleton (grahamd at dscpl.com.au)


More information about the Mod_python mailing list