Skip to content

Commit

Permalink
created hashes for list output
Browse files Browse the repository at this point in the history
  • Loading branch information
siddharm committed Sep 23, 2019
1 parent 3297b9a commit a23abc1
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions ascl_list1.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
import json
import sys
import argparse

import hashlib

# parses arguments for directories, mode, and match ID

Expand Down Expand Up @@ -71,7 +71,7 @@
f1 = open(args.codedir + '/' + args.catalog)
d1 = json.load(f1)

output_str = "Ordinal,Status,Software,Description,Public Code Repo,External Link,Contributors"
output_str = "Ordinal,Hash,Status,Software,Description,Public Code Repo,External Link,Contributors"
print( output_str )
for i in range(len(d1)):
ri = d1[i]
Expand All @@ -93,6 +93,9 @@
d1 = json.load(f1)
r = d1["releases"]
for i in range(len(r)):

m = hashlib.md5()

ri = r[i]

s = ", "
Expand All @@ -103,8 +106,9 @@
desc = "\"" + ri['description'] + "\""
pcr = "\"" + ri["repositoryURL"] + "\""
cont = "\"" + ri["contact"].get("email") + "\""

output_str = s2.join([str(i), str(0), soft, desc, pcr, el, cont])
m = hashlib.md5(bytes((el+soft+desc+pcr+cont))).hexdigest()

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


Expand Down

0 comments on commit a23abc1

Please sign in to comment.