def write_log(target_uri, doi, pmid, found_rrids, head, body, text, h):
now = datetime.now().isoformat()[0:19].replace(':','').replace('-','')
frv = list(set(found_rrids.values()))
if len(frv) == 1 and frv[0] == 'Already Annotated':
head, body, text = None, None, None
log = {'target_uri':target_uri,
'group':h.group,
'doi':doi,
'pmid':pmid,
'found_rrids':found_rrids,
'count':len(found_rrids),
'head':head,
'body':body,
'text':text,
}
fname = 'logs/' + 'rrid-%s.json' % now
with open(fname, 'wt') as f:
json.dump(log, f, sort_keys=True, indent=4)
评论列表
文章目录