Revision 1705
Added by Aaron Marcuse-Kubitza over 12 years ago
repl | ||
---|---|---|
3 | 3 |
# A->C or B->C |
4 | 4 |
|
5 | 5 |
import csv |
6 |
import os.path |
|
6 | 7 |
import re |
7 | 8 |
import sys |
8 | 9 |
|
10 |
sys.path.append(os.path.dirname(__file__)+"/../lib") |
|
11 |
|
|
12 |
import maps |
|
13 |
|
|
9 | 14 |
def main(): |
10 | 15 |
try: _prog_name, repl_path = sys.argv[:2] |
11 | 16 |
except ValueError: |
... | ... | |
37 | 42 |
reader = csv.reader(sys.stdin) |
38 | 43 |
writer = csv.writer(sys.stdout) |
39 | 44 |
cols = reader.next() |
40 |
label, sep, root = cols[col_num].partition(':')
|
|
45 |
label, root = maps.col_info(cols[col_num])[:2]
|
|
41 | 46 |
if label != repl_in: raise SystemExit('Map error: Map column '+ |
42 | 47 |
str(col_num)+' label "'+label+'" doesn\'t match replacements input ' |
43 | 48 |
'column label "'+repl_in+'"') |
Also available in: Unified diff
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.