Lines Matching refs:args
308 def create_intermediate_csv(args, keys_in_config_file, keys_in_values_file, keys_repeat, is_encr=Fa… argument
316 config_data_to_write = add_config_data_per_namespace(args.conf)
319 with open(args.values, 'r', newline=None) as csv_values_file:
326 filename, file_ext = os.path.splitext(args.values)
329 target_values_file = set_repeat_value(keys_repeat, keys, args.values, target_filename)
331 target_values_file = args.values
339 output_csv_target_dir = create_dir(csv_str, args.outdir)
341 output_bin_target_dir = create_dir(bin_str, args.outdir)
342 if args.keygen:
354 file_identifier_value = get_fileid_val(args.fileid, keys_in_config_file,
361 csv_filename = args.prefix + '-' + file_identifier_value + '.' + csv_str
371 bin_filename = args.prefix + '-' + file_identifier_value + '.' + bin_str
376 args.input = output_csv_file
377 args.output = os.path.join(bin_str, bin_filename)
379 args.keyfile = 'keys-' + args.prefix + '-' + file_identifier_value
382 nvs_partition_gen.encrypt(args)
384 nvs_partition_gen.generate(args)
394 print('\nFiles generated in %s ...' % args.outdir)
413 def verify_file_format(args): argument
420 if os.stat(args.conf).st_size == 0:
421 raise SystemExit('Error: config file: %s is empty.' % args.conf)
424 if os.stat(args.values).st_size == 0:
425 raise SystemExit('Error: values file: %s is empty.' % args.values)
428 with open(args.conf, 'r', newline='\n') as csv_config_file:
431 verify_empty_lines_exist(args.conf, file_data)
447 with open(args.values, 'r', newline='\n') as csv_values_file:
459 verify_empty_lines_exist(args.values, file_data)
468 if args.fileid:
469 if args.fileid not in keys_in_values_file:
470 …aise SystemExit('Error: target_file_identifier: %s does not exist in values file.\n' % args.fileid)
472 args.fileid = 1
477 def generate(args): argument
483 args.outdir = os.path.join(args.outdir, '')
485 keys_in_config_file, keys_in_values_file, keys_repeat = verify_file_format(args)
488 verify_data_in_file(args.conf, args.values, keys_in_config_file,
491 if (args.keygen or args.inputkey):
496 create_intermediate_csv(args, keys_in_config_file, keys_in_values_file,
500 def generate_key(args): argument
501 nvs_partition_gen.generate_key(args)
572 args = parser.parse_args()
573 args.func(args)