Skip to content

Commit

Permalink
Minor code improvements
Browse files Browse the repository at this point in the history
  • Loading branch information
SteffenBrinckmann committed May 14, 2024
1 parent 627e859 commit 0ce9ee1
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion tools/eln2md.py
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,8 @@ def process_part(part, level):
ro_crate_node = [i for i in graph if i["@id"] == METADATA_FILE][0]
output = '- '+METADATA_FILE+'\n'
if 'sdPublisher' in ro_crate_node:
output += ' - publisher: ' + ro_crate_node['sdPublisher']['name'] + '\n'
name = ro_crate_node['sdPublisher'].get('name','---')
output += ' - publisher: ' + name + '\n'
if 'version' in ro_crate_node:
output += ' - version: ' + ro_crate_node['version'] + '\n'
main_node = [i for i in graph if i["@id"] == "./"][0]
Expand Down Expand Up @@ -112,6 +113,7 @@ def process_part(part, level):
outfile.write(f'```json\n{outputString}\n```\n')
elif args.format == 'tree':
outputString = tree(metadataContent)
print(outputString)
outfile.write(f'```yml\n{outputString}\n```\n')
else:
print("**ERROR: unknown format")
Expand Down

0 comments on commit 0ce9ee1

Please sign in to comment.