Skip to content

Commit ab86f77

Browse files
committed
Allow columns to be of undefined width
There are a couple of text columns appended to the lines which do not have a fixed width.
1 parent 8ca1d36 commit ab86f77

File tree

1 file changed

+7
-5
lines changed

1 file changed

+7
-5
lines changed

pipelineviewer/main.py

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -61,14 +61,15 @@ def render(pipeline, args):
6161
header_legend = " ".join(header_legend)
6262
args.outfile.write(header_legend)
6363

64-
col_width = {'m': 1, 'r': 8, 't': 17, 'p': 16, 'i': 20, 'e': 40 }
64+
col_width = {'m': 1, 'r': 8, 't': 17, 'p': 16 }
6565

6666
col_pos = {}
6767
pos = args.width + 1
6868
for c in args.format:
6969
pos += 1
7070
col_pos[c] = pos
71-
pos += col_width[c]
71+
if c in col_width:
72+
pos += col_width[c]
7273

7374
if "m" in args.format:
7475
print(" "*(col_pos['m']-1) + colorama.Style.BRIGHT +
@@ -186,9 +187,10 @@ def render(pipeline, args):
186187
else:
187188
line += ", BHT @{} not taken ({:02b}->{:02b})".format(
188189
i.BHT.index, i.BHT.oldcounter, i.BHT.newcounter)
189-
if width < col_width[c]:
190-
line += " "*(col_width[c] - width)
191-
col += col_width[c]
190+
if c in col_width:
191+
if width < col_width[c]:
192+
line += " "*(col_width[c] - width)
193+
col += col_width[c]
192194
args.outfile.write(line+"\n")
193195
colorama.deinit()
194196

0 commit comments

Comments
 (0)