Skip to content

Commit 51cc17b

Browse files
utils.py: fix yaml output
Fixes bug: getpatchwork#70 with incorrect output for 'Patches' property in .yaml format. Signed-off-by: Oleg Ananiev <[email protected]>
1 parent a5f5bbe commit 51cc17b

File tree

1 file changed

+17
-0
lines changed

1 file changed

+17
-0
lines changed

git_pw/utils.py

+17
Original file line numberDiff line numberDiff line change
@@ -94,6 +94,23 @@ def _tabulate(
9494
writer.writerow([ensure_str(i) for i in item])
9595
return result.getvalue()
9696
elif fmt == 'yaml':
97+
98+
tempout = []
99+
patch = ()
100+
for entry in output:
101+
102+
if entry[0] == 'Patches':
103+
l1 = [entry[1]]
104+
patch = ('Patches',l1)
105+
106+
elif len(patch) != 0 and entry[0] == '':
107+
elem = entry[1]
108+
patch[1].append(elem)
109+
else:
110+
tempout.append(entry)
111+
output = tempout
112+
output.append(patch)
113+
97114
data = [
98115
{headers[i].lower(): entry[i] for i in range(len(headers))}
99116
for entry in output

0 commit comments

Comments
 (0)