@cli.command()<EOL>@click.argument('<STR_LIT>', nargs=-<NUM_LIT:1>)<EOL>@click.option('<STR_LIT>', '<STR_LIT>', '<STR_LIT>', is_flag=True,<EOL>help='<STR_LIT>')<EOL>def load(patterns, full_reindex):
header('<STR_LIT>')<EOL>for pattern in patterns:<EOL><INDENT>for filename in iglob(pattern):<EOL><INDENT>echo('<STR_LIT>'.format(white(filename)))<EOL>with open(filename) as f:<EOL><INDENT>reader = csv.reader(f)<EOL>reader.next()<EOL>for idx, row in enumerate(reader, <NUM_LIT:1>):<EOL><INDENT>try:<EOL><INDENT>advice = csv.from_row(row)<EOL>skipped = False<EOL>if not full_reindex:<EOL><INDENT>index(advice)<EOL><DEDENT>echo('<STR_LIT:.>' if idx % <NUM_LIT:50> else white(idx), nl=False)<EOL><DEDENT>except Exception:<EOL><INDENT>echo(cyan('<STR_LIT:s>') if idx % <NUM_LIT:50> else white('<STR_LIT>'.format(idx)), nl=False)<EOL>skipped = True<EOL><DEDENT><DEDENT>if skipped:<EOL><INDENT>echo(white('<STR_LIT>'.format(idx)) if idx % <NUM_LIT:50> else '<STR_LIT>')<EOL><DEDENT>else:<EOL><INDENT>echo(white(idx) if idx % <NUM_LIT:50> else '<STR_LIT>')<EOL><DEDENT>success('<STR_LIT>'.format(idx))<EOL><DEDENT><DEDENT><DEDENT>if full_reindex:<EOL><INDENT>reindex()<EOL><DEDENT>
Load one or more CADA CSV files matching patterns