Project

General

Profile

« Previous | Next » 

Revision 1946

Made row #s 1-based to the user to match up with the staging table row #s

View differences:

map
52 52
    def usage_err():
53 53
        raise SystemExit('Usage: '+opts.env_usage(env_names, True)+' '
54 54
            +sys.argv[0]+' [map_path...] [<input] [>output]\n'
55
            'Note: Row #s start with 0')
55
            'Note: Row #s start with 1')
56 56
    
57 57
    ## Get config from env vars
58 58
    
......
64 64
        # never redo in commit mode (manually run `make empty_db` instead)
65 65
    
66 66
    # Ranges
67
    start = util.cast(int, opts.get_env_var('start', 0, env_names)) # 0-based
67
    start = util.cast(int, opts.get_env_var('start', 1, env_names)) # 1-based
68
    # Make start interally 0-based.
69
    # It's 1-based to the user to match up with the staging table row #s.
70
    start -= 1
68 71
    if test: n_default = 1
69 72
    else: n_default = None
70 73
    n = util.cast(int, util.none_if(opts.get_env_var('n', n_default, env_names),
......
301 304
            
302 305
            def row_ready(row_num, input_row):
303 306
                def on_error(e):
304
                    exc.add_msg(e, term.emph('row #:')+' '+str(row_num))
307
                    exc.add_msg(e, term.emph('row #:')+' '+str(row_num+1))
308
                        # row # is interally 0-based, but 1-based to the user
305 309
                    exc.add_msg(e, term.emph('input row:')+'\n'+str(input_row))
306 310
                    exc.add_msg(e, term.emph('output row:')+'\n'+str(root))
307 311
                    ex_tracker.track(e, row_num)

Also available in: Unified diff