-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex
24 lines (19 loc) · 944 Bytes
/
index
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
#!/usr/bin/env python3
import argparse
import json
import subprocess
print("Indexing ...")
parser = argparse.ArgumentParser()
parser.add_argument("--json", type=json.loads, required=True, help="the json input")
args, unknown = parser.parse_known_args()
# Iterate over the collections
for collection in args.json["collections"]:
name, path = collection["name"], collection["path"]
if name.lower() == "robust04":
subprocess.run("/indexRobust04.sh {} {} {}".format(collection["path"], collection["name"], collection["format"]), shell=True)
elif name.lower() == "gov2":
subprocess.run("/indexGOV2.sh {} {} {}".format(collection["path"], collection["name"], collection["format"]), shell=True)
elif name.lower() == "core18":
subprocess.run("/indexCore18.sh {} {} {}".format(collection["path"], collection["name"], collection["format"]), shell=True)
else:
print("Unknown collection: " + name)