Revision 5787
Added by Aaron Marcuse-Kubitza over 12 years ago
tnrs_db | ||
---|---|---|
72 | 72 |
log('Making TNRS request') |
73 | 73 |
now_str = str(dates.now()) |
74 | 74 |
tnrs_profiler.start() |
75 |
try: |
|
76 |
try: stream = tnrs.repeated_tnrs_request(names) |
|
77 |
finally: |
|
78 |
tnrs_profiler.stop(iter_ct=this_ct) |
|
79 |
log('Cumulatively: '+tnrs_profiler.msg()) |
|
80 |
else: |
|
81 |
log('Storing TNRS response data') |
|
82 |
reader, header = csvs.reader_and_header(stream) |
|
83 |
header.insert(0, time_col_name) |
|
84 |
reader = csvs.ColInsertFilter(reader, lambda row, row_num: now_str) |
|
85 |
sql_io.append_csv(db, tnrs_data, reader, header) |
|
75 |
try: stream = tnrs.repeated_tnrs_request(names) |
|
76 |
finally: |
|
77 |
tnrs_profiler.stop(iter_ct=this_ct) |
|
78 |
log('Cumulatively: '+tnrs_profiler.msg()) |
|
79 |
|
|
80 |
log('Storing TNRS response data') |
|
81 |
reader, header = csvs.reader_and_header(stream) |
|
82 |
header.insert(0, time_col_name) |
|
83 |
reader = csvs.ColInsertFilter(reader, lambda row, row_num: now_str) |
|
84 |
sql_io.append_csv(db, tnrs_data, reader, header) |
|
86 | 85 |
|
87 | 86 |
main() |
Also available in: Unified diff
tnrs_db: Making TNRS request: Fixed bug where needed to remove else block now that there is no except block