Project

General

Profile

« Previous | Next » 

Revision 1705

ch_root, repl, map: Use new maps.col_info() instead of parsing col name manually. This allows maps with prefixes containing ":" to be supported, without the ":" being misinterpreted as the label-root separator.

View differences:

ch_root
8 8

  
9 9
sys.path.append(os.path.dirname(__file__)+"/../lib")
10 10

  
11
import maps
11 12
import opts
12 13

  
13 14
def main():
......
26 27
    cols = reader.next()
27 28
    for i in xrange(len(configs)):
28 29
        config = configs[i]
29
        label, sep, config['root'] = cols[i].partition(':')
30
        cols[i] = label+sep+config['out_root']
30
        label, config['root'] = maps.col_info(cols[i], require_root=True)[:2]
31
        cols[i] = label+':'+config['out_root']
31 32
        config['in_root_re'] = r'^'+re.escape(config['in_root'])+r'(?=\b|\W|$)'
32 33
    writer.writerow(cols)
33 34
    for row in reader:

Also available in: Unified diff