Apache Mod-Python - Resolved: (MODPYTHON-164) Allow

This is Interesting: Free IT Magazines  
Home > Archive > Apache Mod-Python > July 2006 > Resolved: (MODPYTHON-164) Allow





You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

Author Resolved: (MODPYTHON-164) Allow
Graham Dumpleton (JIRA)

2006-07-30, 7:12 am

[ http://issues.apache.org/jira/brows...ON-164?page=all ]

Graham Dumpleton resolved MODPYTHON-164.
----------------------------------------

Fix Version/s: 3.3
Resolution: Fixed

> Allow req.add_handler()/req.register_*_filter() to take module/function for handler.
> ------------------------------------------------------------------------------------
>
> Key: MODPYTHON-164
> URL: http://issues.apache.org/jira/browse/MODPYTHON-164
> Project: mod_python
> Issue Type: New Feature
> Components: core
> Reporter: Graham Dumpleton
> Assigned To: Graham Dumpleton
> Fix For: 3.3
>
>
> Currently, the:
> req.add_handler(phase, handler, dir)
> req.register_input_filter(filter_name, filter, dir)
> req.register_output_filter(filter_name, filter, dir)
> functions require the handler/filter to be a string. This string identifies the module that should be imported and which contains the necessary function, plus optionally, an alternate named function to the default for the phase or filter type. For examp

le:
> req.add_handler("PythonHandler", "mymodule::myhandler")
> It would be simpler if the handler/filter argument could be overloaded and instead supplied an actual module reference or callable object reference. For example:
> import mymodule
> def myhandler(req):
> ...
> def fixuphandler(req):
> req.add_handler("PythonHandler", mymodule)
> req.add_handler("PythonHandler", mymodule.myhandler)
> req.add_handler("PythonHandler", myhandler)
> return apache.OK
> This would be easier than having to construct a string module/function reference when you have direct access to the handler function.
> In the main the "dir" argument would be irrelevant. The only circumstance where it would matter is where PythonInterpPerDirective was used as it could be used to control the interpreter the code executed within. If not supplied, it could be argued that

the directory where the supplied module/function is defined in should be used as "dir".

Sponsored Links






Free braindumps | Software forum | Database administration forum

Copyright 2003 - 2008 webservertalk.com