Project

General

Profile

« Previous | Next » 

Revision 5151

tnrs.py: tnrs_request(): Rewrapped lines (became >80 chars after adding profiling)

View differences:

lib/tnrs.py
144 144
        request = submission_request_template.replace('[names]',
145 145
            gwt_encode('\n'.join(map(encode, names))))
146 146
        response, response_info = do_request(request)
147
        key, = parse_response('submission', submission_response_pattern, response,
148
            response, response_info)
147
        key, = parse_response('submission', submission_response_pattern,
148
            response, response, response_info)
149 149
        debug_log('key', key)
150 150
        key_enc = gwt_encode(key)
151 151
        
152 152
        debug_log('Retrieve')
153 153
        request = retrieval_request_template.replace('[key]', key_enc)
154 154
        response, response_info = do_repeated_request(request)
155
        parse_response('retrieval', retrieval_response_pattern, response, response,
155
        parse_response('retrieval', retrieval_response_pattern, response,
156
            response, response_info)
157
        session_id, = parse_response('retrieval info',
158
            retrieval_response_info_pattern, response_info, response,
156 159
            response_info)
157
        session_id, = parse_response('retrieval info',
158
            retrieval_response_info_pattern, response_info, response, response_info)
159 160
        debug_log('session_id', session_id)
160 161
        headers['Cookie'] = 'JSESSIONID='+session_id
161 162
        
162 163
        # The output of the retrieve step is unusable because the array has
163
        # different lengths depending on the taxonomic ranks present in the provided
164
        # taxon name. The extra download step is therefore necessary.
164
        # different lengths depending on the taxonomic ranks present in the
165
        # provided taxon name. The extra download step is therefore necessary.
165 166
        
166 167
        debug_log('Prepare download')
167 168
        request = download_request_template.replace('[key]', key_enc)
168 169
        response, response_info = do_request(request)
169
        csv_url, = parse_response('download', download_response_pattern, response,
170
            response, response_info)
170
        csv_url, = parse_response('download', download_response_pattern,
171
            response, response, response_info)
171 172
        csv_url += download_url_suffix
172 173
        debug_log('csv_url', csv_url)
173 174
        

Also available in: Unified diff