Resolved: (MODPYTHON-164) Allow
Web Server forum
Back To The Forum Home!Search!Private Messaging System

Web Server Talk Web Server Talk > Web Servers reviews > Apache Server configuration support > Apache Mod-Python > Resolved: (MODPYTHON-164) Allow




  Last Thread   Next Thread Next
  Show Printable Version Email this Page Subscribe to this Thread      Post New Thread    Post A Reply      

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


View Ip Address Report This Message To A Moderator Edit/Delete Message


 
07-30-06 12:12 PM

[ 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 fo
r 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 mo
dule that should be imported and which contains the necessary function, plus optiona
lly, an alternate named function to the default for the phase or filter type. For ex
amp
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. F
or 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 ref
erence 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 cont
rol the interpreter the code executed within. If not supplied, it could be argued th
at
the directory where the supplied module/function is defined in should be use
d as "dir".






[ Post a follow-up to this message ]



    Sponsored Links  




 





   All times are GMT. The time now is 08:21 AM.      Post New Thread    Post A Reply      
  Last Thread   Next Thread Next


Most Popular forums 

Forum Jump:
Rate This Thread:

Forum Rules:
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
HTML code is OFF
vB code is ON
Smilies are ON
[IMG] code is OFF
 
Medical and Health forum | Computer Games Reviews | Graphics design forum

Back To The Top
Home | Usercp | Faq | Register