Commit cde1d1ff authored by Jungho Shin's avatar Jungho Shin

using buffer stream for stdin and stdout

parent a9c39a49
......@@ -16,8 +16,9 @@ def calculateTags(inputDict, backend, calcUri):
backend.openContext(calcUri)
repoSect = backend.openSection("section_repository_info")
repo_dic_sub = subprocess.Popen(['/u/jungho/myscratch/NomadRepositoryParser/bin/python', 'extract_from_repo.py'], stdin = subprocess.PIPE, stdout = subprocess.PIPE)
repo_dic_sub_out = repo_dic_sub.communicate(json.dumps(inputDict)+'\n')[0]
repo_dic = json.loads(repo_dic_sub_out)
inputDict_str = json.dumps(inputDict)+'\n'
repo_dic_sub_out = repo_dic_sub.communicate(inputDict_str.encode('utf-8'))[0]
repo_dic = json.loads(repo_dic_sub_out.decode("utf-8"))
#backend.addValue("repository_checksum", repo_dic['checksum'])
backend.addValue("repository_chemical_formula", repo_dic['formula'])
......@@ -54,8 +55,8 @@ def main():
calcUri,
parserInfo = {'name':'RepoTagsNormalizer', 'version': '1.0'})
dictReader=ParseStreamedDicts(sys.stdin)
#dictReader=ParseStreamedDicts(open("/u/jungho/myscratch/nomad-lab-base/normalizers/repo-tags/test/examples/scalaOut2.txt", 'r'))
#dictReader=ParseStreamedDicts(sys.stdin)
dictReader=ParseStreamedDicts(open("/u/jungho/myscratch/nomad-lab-base/normalizers/repo-tags/test/examples/scalaOut2.txt", 'r'))
while True:
inputDict=dictReader.readNextDict()
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment