Currently format_bytes output (such as ceph fs status) makes unit black, which is
hard to distinguish on black terminals, so change them as same as the data itself.
Signed-off-by: haoyixing <haoyixing@kuaishou.com>
unit = 0
while len("%s" % (int(n) // (1000**unit))) > width - 1:
if unit >= len(units) - 1:
- break;
+ break
unit += 1
if unit > 0:
else:
color = self.YELLOW, False
return self.bold(self.colorize(formatted[0:-1], color[0], color[1])) \
- + self.bold(self.colorize(formatted[-1], self.BLACK, False))
+ + self.bold(self.colorize(formatted[-1], self.YELLOW, False))
else:
return formatted
else:
color = YELLOW, False
return bold(colorize(formatted[0:-1], color[0], color[1])) \
- + bold(colorize(formatted[-1], BLACK, False))
+ + bold(colorize(formatted[-1], YELLOW, False))
else:
return formatted