systemd-analyze: call os.uname() once

Uses a format string, which is dependent on python 2.6.
This commit is contained in:
Dave Reisner
2012-02-27 08:14:58 -05:00
committed by Lennart Poettering
parent 6a39419fe4
commit a84f9b3c1d

View File

@@ -172,7 +172,7 @@ elif sys.argv[1] == 'plot':
osrel = osrel.strip('\"\n')
break
banner = "%s %s (%s %s) %s" % (osrel, os.uname()[1], os.uname()[2], os.uname()[3], os.uname()[4])
banner = "{} {} ({} {}) {}".format(osrel, *(os.uname()[1:5]))
draw_text(context, 0, -15, banner, hcenter = 0, vcenter = 1)
for x in range(0, finish_time/10000 + 100, 100):