Project

General

Profile

« Previous | Next » 

Revision 7133

inputs/.TNRS/schema.sql: tnrs: Added Accepted_scientific_name field which will contain the joined-together accepted name that gets re-parsed by TNRS

View differences:

tnrs_db
28 28
tnrs_input = sql_gen.Table('tnrs_input_name')
29 29
tnrs_data = sql_gen.Table('tnrs')
30 30
time_col_name = 'Time_submitted'
31
name_col_name = 'Accepted_scientific_name'
31 32

  
32 33
def main():
33 34
    # Input
......
79 80
        log('Storing TNRS response data')
80 81
        reader, header = csvs.reader_and_header(stream)
81 82
        header.insert(0, time_col_name)
83
        name_col_idx = len(header)
84
        header.append(name_col_name)
82 85
        reader = csvs.ColInsertFilter(reader, lambda row, row_num: now_str)
86
        reader = csvs.ColInsertFilter(reader, lambda row, row_num: None,
87
            name_col_idx)
83 88
        sql_io.append_csv(db, tnrs_data, reader, header)
84 89

  
85 90
main()

Also available in: Unified diff