Project

General

Profile

« Previous | Next » 

Revision 735

join: Moved mappings-specific merge functionality into maps.merge_mappings()

View differences:

join
34 34
    writer.writerow(cols)
35 35
    for row in reader:
36 36
        if row[1] != '':
37
            try:
38
                new = map_1[row[1]]
39
                row[1] = new[1] # mapping
40
                row[2:] = maps.merge_rows(row[2:], new[2:]) # comments
37
            try: out_row = map_1[row[1]]
41 38
            except KeyError:
42 39
                row[2] = '** No join mapping for '+row[1]+' ** '+row[2]
43 40
                row[1] = ''
41
            else: row = maps.merge_mappings(row, out_row)
44 42
        writer.writerow(row)
45 43

  
46 44
main()

Also available in: Unified diff