[mod_python] Sugestion about publisher

Gregory Trubetskoy grisha at modpython.org
Tue Jan 2 17:22:09 EST 2001


But I wonder what the usability of such a feature might be. (I'm not
aysing I'm against it, I'd just like to have a small discussion about it
first). 

In general, I do not like implicit or default stuff like this - I think if
you're specifying a module without a method, you should get nothing in
return. 

Another note - this modifies PATH_INFO. I think PATH_INFO should always
represent what the user passed. 


On Mon, 1 Jan 2001, Damjan wrote:

> Here is a small patch for mod_python.publisher, that instead of raising an
> error when there is no PATH_INFO, it substitutes a default PATH_INFO. 
> (I choose index_html, perhaps a diferent default method can be chosen)
> 
> That way when we call a script without specifying a method, the method
> index_html is called.
> 
> --- publisher.py.old    Mon Jan  1 21:48:04 2001
> +++ publisher.py        Mon Jan  1 21:47:39 2001
> @@ -81,7 +81,7 @@
>  
>      # get the path PATH_INFO (everthing after script)
>      if not _req.subprocess_env.has_key("PATH_INFO"):
> -        raise apache.SERVER_RETURN, apache.HTTP_NOT_FOUND
> +        _req.subprocess_env["PATH_INFO"]="/index_html"
>      
>      func_path = _req.subprocess_env["PATH_INFO"][1:] # skip fist /
>      func_path = string.replace(func_path, "/", ".")
> 
> 
> -- 
> Damjan Georgievski		|           Дамјан Георгиевски
> Skopje, Macedonia		|           Скопје, Македонија
> _______________________________________________
> Mod_python mailing list
> Mod_python at modpython.org
> http://www.modpython.org/mailman/listinfo/mod_python
> 




More information about the Mod_python mailing list