32 parser = argparse.ArgumentParser(description=__doc__)
33 parser.add_argument(
34 '--path_prefix', help='Directory path containing the manifest entry sources', required=True
35 )
36 parser.add_argument('--input', help='Path to original manifest', required=True)
37 parser.add_argument('--output', help='Path to the updated json file', required=True)
38 args = parser.parse_args()
39
40 with open(args.input, 'r') as input_file:
41 contents = input_file.read().splitlines()
42
43 entries =
collect(args.path_prefix, contents)
44
45 if entries is None:
46 return 1
47
48 with open(args.output, 'w') as output_file:
49 json.dump([e._asdict() for e in entries],
50 output_file,
51 indent=2,
52 sort_keys=True,
53 separators=(',', ': '))
54
55 return 0
56
57