Revision 5093
Added by Aaron Marcuse-Kubitza over 12 years ago
tnrs_db | ||
---|---|---|
61 | 61 |
total_pause = 0 |
62 | 62 |
|
63 | 63 |
# Run TNRS |
64 |
stream = tnrs.repeated_tnrs_request(list(sql.values(cur))) |
|
65 |
stream_info = csvs.stream_info(stream, parse_header=True) |
|
66 |
stream = streams.ProgressInputStream(stream, sys.stderr, n=1000) |
|
67 |
sql_io.append_csv(db, tnrs_data, stream_info, stream) |
|
64 |
try: stream = tnrs.repeated_tnrs_request(list(sql.values(cur))) |
|
65 |
except InvalidResponse: pass # skip this set in case it caused the error |
|
66 |
else: |
|
67 |
stream_info = csvs.stream_info(stream, parse_header=True) |
|
68 |
stream = streams.ProgressInputStream(stream, sys.stderr, n=1000) |
|
69 |
sql_io.append_csv(db, tnrs_data, stream_info, stream) |
|
68 | 70 |
|
69 | 71 |
main() |
Also available in: Unified diff
tnrs_db: If tnrs.repeated_tnrs_request() stil throws InvalidResponse, skip the current set in case its data caused the error. Note that it will still be tried again the next time tnrs_db is run.