Skip to content

Commit 93b027f

Browse files
committed
nicer output of relocated inputBindings
1 parent b3c4e67 commit 93b027f

File tree

1 file changed

+10
-3
lines changed

1 file changed

+10
-3
lines changed

cwlupgrader/main.py

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -26,8 +26,8 @@ def main(args=None): # type: (Optional[List[str]]) -> int
2626
document = v1_0_to_v1_1(document)
2727
else:
2828
print("Skipping non draft-3 CWL document", file=sys.stderr)
29-
print(ruamel.yaml.round_trip_dump(
30-
document, default_flow_style=False))
29+
ruamel.yaml.scalarstring.walk_tree(document)
30+
print(ruamel.yaml.round_trip_dump(document, default_flow_style=False))
3131
return 0
3232

3333
def v1_0_to_v1_1(document): # type: (Dict[Text, Any]) -> Dict
@@ -132,7 +132,12 @@ def _v1_0_to_v1_1(document):
132132

133133

134134
def cleanup_v1_0_input_bindings(document):
135-
"""In v1.1 only loadContents is allow in inputs for a Workflow or ExpressionTool."""
135+
"""
136+
In v1.1 Workflow or ExpressionTool level inputBindings are no more.
137+
138+
'loadContents' is promoted up a level, the rest make no sense in v1.0, but document their contents anyways
139+
140+
"""
136141
def cleanup(inp):
137142
"""Serialize non loadContents fields and add that to the doc."""
138143
if 'inputBinding' in inp:
@@ -142,6 +147,8 @@ def cleanup(inp):
142147
prefix = '' if 'doc' not in inp else '{}\n'.format(inp['doc'])
143148
inp['doc'] = WORKFLOW_INPUT_INPUTBINDING.format(prefix, field)
144149
del bindings[field]
150+
else:
151+
inp[field] = bindings.pop(field)
145152
if not bindings:
146153
del inp['inputBinding']
147154
inputs = document['inputs']

0 commit comments

Comments
 (0)