Skip to content

Commit d3a22d6

Browse files
committed
- even more formatting
Change-Id: I6e4ddcb699ef76c4f55ed091a11a0769f4364c12
1 parent c444bb1 commit d3a22d6

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

sqlalchemy_collectd/connmon/display.py

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,11 @@ def _just(text, width):
3535
def _justify_rows(text):
3636
width = _text_width(text)
3737
return [_just(row, width) for row in text.split("\n")]
38-
# return text.split("\n")
38+
39+
40+
def _dash_for_fmt(fmt_frag):
41+
sample = fmt_frag % 5
42+
return "".join(" " if char != "5" else "-" for char in sample)
3943

4044

4145
class Layout(object):
@@ -128,7 +132,9 @@ def _render_row(self, display, row, y):
128132

129133
elem = " ".join(
130134
[
131-
(fmt_frag % elem_frag) if elem_frag is not None else "-"
135+
(fmt_frag % elem_frag)
136+
if elem_frag is not None
137+
else _dash_for_fmt(fmt_frag)
132138
for fmt_frag, elem_frag in zip(fmt.split("/"), elem)
133139
]
134140
)

0 commit comments

Comments
 (0)