Project

General

Profile

« Previous | Next » 

Revision 4156

join: quiet mode: Turn off all warnings, not just "No input mapping" warnings. This is useful when join-unioning a synonymy to a primary map, which may have "No non-empty join mapping" for some terms but this should not be stored in the resulting map's Comments column.

View differences:

join
49 49
    writer.writerow(maps.merge_mappings(map_0_cols, map_1_cols))
50 50
    for row in reader:
51 51
        def set_error(msg):
52
            warnings.warn(UserWarning(msg))
53
            row[2] = '** '+msg+' ** '+util.list_setdefault(row, 2, '')
54 52
            row[1] = ''
53
            if not quiet:
54
                warnings.warn(UserWarning(msg))
55
                row[2] = '** '+msg+' ** '+util.list_setdefault(row, 2, '')
55 56
        
56 57
        row_written = False
57 58
        if row[1] != '':
......
90 91
                msg += ' join mapping for '+out_orig
91 92
                set_error(msg)
92 93
        elif row[2] == '': # also no comment explaining why no input mapping
93
            if not quiet: set_error('No input mapping for '+row[0])
94
            set_error('No input mapping for '+row[0])
94 95
        
95 96
        if not row_written: writer.writerow(row)
96 97

  

Also available in: Unified diff