[mod_python] Directory or Location?

Gregory (Grisha) Trubetskoy grisha at modpython.org
Thu Jun 12 14:20:10 EST 2003



On Thu, 12 Jun 2003, emf wrote:

> * I battled for a while with TransHandler, but it seems to me that if
> you write a TransHandler it must do everything that the regular
> TransHandler does as well as whatever you want; there's no way to make
> a TransHandler that only translates some requests, and punts the rest
> to apache's normal handling. (someone please correct me if I'm wrong.)

You should be able to return DECLINED in which case Apache will do its
default thing.

> Additionally, I never got req.add_handler("PythonHandler",myhandlername)
> to do what I expected - i.e. act like SetHandler for that request

Not sure what you mean by this. It should execute, though if you have
another PythonHandler, that handler will execute first.

> (but if it doesn't work that way, how come you can't specify extension
> in .add_handler() ?

Because you can first look at the extension, then decide whether to
add_handler()?, e.g.:

	if ext == ".foo":
		req.add_handler("PythonHandler", myfoohandler)
	else:
		# do something else

Grisha



More information about the Mod_python mailing list