venissieux-technocarte: add --sample-numlines option
This commit is contained in:
parent
dac9a3c07c
commit
48e620475e
|
@ -81,7 +81,7 @@ def get_rows(args):
|
|||
with open(args.filepath) as csvfile:
|
||||
reader = csv.DictReader(csvfile, delimiter=';', quotechar='"')
|
||||
for i, row in enumerate(reader):
|
||||
if args.mode != 'full' and i > 100:
|
||||
if args.mode != 'full' and i > args.sample_numlines:
|
||||
break
|
||||
yield row
|
||||
|
||||
|
@ -283,6 +283,7 @@ parser_import = subparsers.add_parser('import')
|
|||
parser_import.set_defaults(func=import_data)
|
||||
parser_import.add_argument('--filepath')
|
||||
parser_import.add_argument('--mode', default='sample', choices=('sample', 'full'))
|
||||
parser_import.add_argument('--sample-numlines', default=100, type=int)
|
||||
parser_import.add_argument('--wcs-api-url')
|
||||
parser_import.add_argument('--wcs-email')
|
||||
parser_import.add_argument('--wcs-orig')
|
||||
|
|
Loading…
Reference in New Issue