[mod_python] [help]please give an input filter example ?

camge is83070 at cis.nctu.edu.tw
Thu Sep 18 18:36:25 EST 2003


Below is my simple input filter inputFilter.py:
-------------------------------------------------------------
def inputfilter(filter):
    f=open('filter.log','ab')#for debug
    data='start'
    while data!=None:
        try:
            data = filter.read()
            if data:
                filter.write(data)
                f.write(str(data))
        except Exception,e:
                f.write(str(e))
                data=None
     if data==None:
        filter.close()
     f.close()
----------------------------------------
httpd.conf:
----------------------------------------
<Location /test/>
     PythonInputFilter inputFilter MyInputFilter
     SetInputFilter MyInputFilter
</Location>


----- Original Message ----- 
From: "David Fraser" <davidf at sjsoft.com>
To: "camge" <is83070 at cis.nctu.edu.tw>
Sent: Thursday, September 18, 2003 6:12 PM
Subject: Re: [mod_python] [help]please give an input filter example ?


> >camge wrote:
> >
> >Hi ,
> >
> >    I have written an output filter, and it works fine.
> >But I dont know how to write an input filter, there are not any examples.
> >I have tried to write an simple input filter according to an output
filter.
> >But it always makes IE hang there.
> >If any one can give me an example about input filter?
> >Thanks a lot!
> >
> >My environment:
> >  Apache/2.0.44 (Win32)
> >  mod_ssl/2.0.44
> >  OpenSSL/0.9.7
> >  mod_python/3.0.3
> >  Python/2.2.2
> >
> >Best regards,
> >camge
> >
> Why don't you send your example input filter that makes IE hang?
>
> Thanks
> David
>
>



More information about the Mod_python mailing list