curl-and-python

RE: Curl RTSP Commands not Available in Python?

From: Utsav Sabharwal <tashywashysachy_at_live.in>
Date: Fri, 9 Mar 2012 13:47:13 +0530

> > To add the RTSP functionality to pycURL, is it a matter of adding the RTSP > > options to pycurl.c ?
> >
> > Example just adding the lines:
> > insint_c(d, "RTSP_STREAM_URI", CURLOPT_RTSP_STREAM_URI);
> > insint_c(d, "RTSP_REQUEST", CURLOPT_RTSP_REQUEST);
>
> It might be worth to make some sort of (python?) script that extracts that
> information from the public curl headers and generates the necessary glue code
> from that, so it will be easier to just re-run it when new libcurl releases
> ship!
>
> libcurl is known to release roughly every second month, and we add new options
> rather frequently...
>
> --
>
> / daniel.haxx.se
>
>

That sounds as a good idea. 
Right now the options are hard coded as per libcurl 7.19.0. Now the problem is each function of C API is mapped with Python API.
For example:

CURLOPT_URL is just called as url in pycURLExample:c.setopt(pycurl.URL, url)
Reference: https://github.com/utsavsabharwal/Crawlers-Research-Arena/blob/master/curl/18/crawler.py
Now, if the code automatically fetches the options from public curl headers then we shall loose the mapping. 
Pros:
 pycURL could be run with any version of libcurl without depreciating any feature. 
Rich libcurl documentation can be used for pycURL also. 
pycURL would not be called an old tool unfit for current internet tackling. Rather, without human support it would remain updated and syncd with libcurl

Cons: 
The codes written in previous pycURL version would not run with the new version 
Users who only use pycURL must now learn libcurl commands which differ from current 
pycURL commands but learning it can make them capable to use C API in future with ease. :p

p,s,: Taking into consideration frequency of libcurl updates and lack of manpower @ pycURL developers I feel making this change would be good. 

d_r_a_g_o_s
                                                                                              
_______________________________________________
http://cool.haxx.se/cgi-bin/mailman/listinfo/curl-and-python
Received on 2012-03-09