Skip to content

Commit

Permalink
Merge branch 'master' of https://github.com/teuben/ascl-tools
Browse files Browse the repository at this point in the history
  • Loading branch information
teuben committed Sep 25, 2019
2 parents 82a8ca7 + 03e514f commit 44b0c7c
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 25 deletions.
23 changes: 11 additions & 12 deletions ascl_list1.py
Original file line number Diff line number Diff line change
Expand Up @@ -79,18 +79,20 @@
s = ", "
s2 = ","

soft = "\"" + ri['Software'] + "\""
desc = "\"" + ri['Description'] + "\""
pcr = "\"" + ri["Public Code Repo"] + "\""
el = "\"" + ri["External Link"] + "\""
cont = "\"" + s.join(ri["Contributors"]) + "\""
soft = "\"" + ri['Software'] + "\""
desc = "\"" + ri['Description'].replace('"', "'") + "\""
pcr = "\"" + ri["Public Code Repo"] + "\""
el = "\"" + ri["External Link"] + "\""
cont = "\"" + s.join(ri["Contributors"]) + "\""

output_str = s2.join([str(i), str(0), soft, desc, pcr, el, cont])
print(output_str.encode("utf8"))

elif mode == 1:
f1 = open(args.codedir + '/' + args.code)
d1 = json.load(f1)
output_str = "Ordinal,Hash,Status,Software,Description,Public Code Repo,External Link,Contributors"
print( output_str )
r = d1["releases"]
for i in range(len(r)):

Expand All @@ -102,10 +104,10 @@
s2 = ","

el = ("\"" + ri.get("homepageURL") + "\"") if ri.get("homepageURL") != None else ("\"" + "None" + "\"")
soft = "\"" + ri['name'] + "\""
desc = "\"" + ri['description'] + "\""
pcr = "\"" + ri["repositoryURL"] + "\""
cont = "\"" + ri["contact"].get("email") + "\""
soft = "\"" + ri['name'] + "\""
desc = "\"" + ri['description'].replace('"', "'") + "\""
pcr = "\"" + ri["repositoryURL"] + "\""
cont = "\"" + ri["contact"].get("email") + "\""
m = hashlib.md5(bytes((el+soft+desc+pcr+cont).encode("utf8"))).hexdigest()

output_str = s2.join([str(i), m, str(0), soft, desc, pcr, el, cont])
Expand Down Expand Up @@ -180,9 +182,6 @@
for c in cat:
print(c)

#prints out the repo in csv formatting


else:
#if match name is provided, print out all the dumps for matching names
if match_name != None:
Expand Down
Loading

0 comments on commit 44b0c7c

Please sign in to comment.