fix: [atrm] fix bug in authors

This commit is contained in:
Christophe Vandeplas 2022-09-23 15:39:49 +02:00
parent 789d3754f8
commit 0609974545

View file

@ -105,13 +105,16 @@ json_cluster = {
with open(os.path.join(args.path, 'docs', 'acknowledgments.md'), 'r') as f: with open(os.path.join(args.path, 'docs', 'acknowledgments.md'), 'r') as f:
for line in f: for line in f:
if line.startswith('* '): if line.startswith('* '):
try:
json_cluster['authors'].append(re.search(r'\w+ [\w&]+', line).group()) json_cluster['authors'].append(re.search(r'\w+ [\w&]+', line).group())
except AttributeError:
json_cluster['authors'].append(re.search(r'\w+', line).group())
# save the Galaxy and Cluster file # save the Galaxy and Cluster file
with open(os.path.join('..', 'galaxies', 'atrm.json'), 'w') as f: with open(os.path.join('..', 'galaxies', 'atrm.json'), 'w') as f:
json.dump(json_galaxy, f, indent=2) json.dump(json_galaxy, f, indent=2, sort_keys=True)
with open(os.path.join('..', 'clusters', 'atrm.json'), 'w') as f: with open(os.path.join('..', 'clusters', 'atrm.json'), 'w') as f:
json.dump(json_cluster, f, indent=2) json.dump(json_cluster, f, indent=2, sort_keys=True)
print("All done, please don't forget to ./jq_all_the_things.sh, commit, and then ./validate_all.sh.") print("All done, please don't forget to ./jq_all_the_things.sh, commit, and then ./validate_all.sh.")