Skip to content

Commit f8c32b8

Browse files
committed
latest attempt at compliance changes dict to list
1 parent 9e155df commit f8c32b8

File tree

1 file changed

+8
-6
lines changed

1 file changed

+8
-6
lines changed

nibabel/cmdline/diff.py

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -121,17 +121,18 @@ def get_headers_diff(files, opts):
121121
else:
122122
header_fields = opts.header_fields.split(',')
123123

124-
output = {}
124+
output = []
125125

126126
for f in header_fields:
127127
val = diff_header_fields(f, header_list)
128128

129129
if val:
130-
output[f] = val
130+
loader = {f: val}
131+
output.append(loader)
131132

132133
return output
133134
else:
134-
return {}
135+
return []
135136

136137

137138
def get_data_md5sums(files):
@@ -182,10 +183,11 @@ def main():
182183
print()
183184

184185
for x in header_diff:
185-
print("{:<11}".format(x), end="")
186+
for key, value in x.items():
187+
print("{:<11}".format(key), end="")
186188

187-
for e in header_diff[x]:
188-
print("{:<45}".format(e), end="")
189+
for item in value:
190+
print("{:<45}".format(str(item)), end="")
189191

190192
print()
191193

0 commit comments

Comments
 (0)