Skip to content

Commit

Permalink
Add ability to process CMSDIST config.map and to get information from…
Browse files Browse the repository at this point in the history
… there.
  • Loading branch information
ktf authored and gudrutis committed Aug 21, 2018
1 parent 0f9fca3 commit 75c523f
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 1 deletion.
15 changes: 15 additions & 0 deletions process-cmsdist
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
#!/usr/bin/env python

# Create a json file from CMSDIST config.map file.

from urllib2 import urlopen
import json

CONFIG_MAP_URL = "https://raw.githubusercontent.com/cms-sw/cmsdist/HEAD/config.map"

if __name__ == "__main__":
f = urlopen("https://raw.githubusercontent.com/cms-sw/cmsdist/HEAD/config.map")
lines = f.read()
entries = [p.strip(";").split(";") for p in lines.split()]
pairs = [dict([i.split("=") for i in e]) for e in entries]
print json.dumps(pairs, sort_keys=True, indent=2, separators=(',', ': '))
7 changes: 6 additions & 1 deletion process-logs
Original file line number Diff line number Diff line change
Expand Up @@ -35,10 +35,15 @@ if __name__ == "__main__":
print(outputs)
pairs = zip(outputs, inputs)
f = open("Makefile", "w")

# A rule which takes care of converting a few known files in CMSDIST to json.

print(".PHONY: all clean", file=f)
print("all: " + " ".join(outputs), file=f)
print("all: data/cmsdist-config.json " + " ".join(outputs), file=f)
print("data/cmsdist-config.json:\n\tmkdir -p `dirname $@` && ./process-cmsdist > $@", file=f)
print("clean:\n\trm -rf data/relvals", file=f)
print("", file=f)
for x in pairs:
l = "%s: %s\n\tmkdir -p `dirname $@` && ./process-run123-logs $< > $@" % x
print(l, file=f)

0 comments on commit 75c523f

Please sign in to comment.