Project

General

Profile

« Previous | Next » 

Revision 5005

tnrs.py: tnrs_request(): Moved CSV-download-specific functionality from do_request() to the Download section

View differences:

lib/tnrs.py
67 67
    ## HTTP
68 68
    headers = initial_headers
69 69
    
70
    def do_request(request=None, url=url, headers=headers):
70
    def do_request(request):
71 71
        debug_log('request', str(request))
72 72
        response = urllib2.urlopen(urllib2.Request(url, request, headers))
73 73
        response_str = streams.read_all(response)
......
118 118
    debug_log('csv_url', csv_url)
119 119
    
120 120
    debug_log('Download')
121
    response, response_info = do_request(url=csv_url, headers={})
122
    return response
121
    response = urllib2.urlopen(urllib2.Request(csv_url))
122
    response_str = streams.read_all(response)
123
    debug_log('response info', str(response.info()))
124
    return response_str

Also available in: Unified diff