From: Esko Kokkonen Date: Sat, 24 Sep 2011 11:23:51 +0000 (+0300) Subject: Beautify output X-Git-Url: http://git.itanic.dy.fi/?p=emerge-timer;a=commitdiff_plain;h=c5256d3ac972a61aa84522e2a680c50145d1250b Beautify output Have the '>>>' start on the same place on each row for easy emerge time comparison. --- diff --git a/emerge-timer.py b/emerge-timer.py index 3c40b6e..1d37688 100755 --- a/emerge-timer.py +++ b/emerge-timer.py @@ -95,11 +95,17 @@ class package: if QUIET == False: + string_length = 0 + for p in self.versions: + if len(p[0]) > string_length: + string_length = len(p[0]) + for p in self.versions: print('-'*90 + "\n" + - green_start + self.name + p[0] + color_stop + - " >>> " + give_time(p[1]) + " >>> " + give_date(p[2])) + green_start + self.name + (p[0]).ljust(string_length) + + color_stop + " >>> " + give_time(p[1]) + " >>> " + + give_date(p[2])) print('-'*90 + "\n" + "Package " + green_start + self.name + color_stop + " emerged " +