From: Zac Medico Date: Sat, 15 Jul 2006 07:15:27 +0000 (-0000) Subject: Use calculations to center --info header titles. X-Git-Tag: v2.1.1~225 X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=da439471c5adfc402290657ad338f557b8f4a181;p=portage.git Use calculations to center --info header titles. svn path=/main/trunk/; revision=3881 --- diff --git a/bin/emerge b/bin/emerge index 2a2dea3ed..3ddd61c2a 100755 --- a/bin/emerge +++ b/bin/emerge @@ -2988,10 +2988,12 @@ def action_info(settings, trees, myopts, myfiles): print getportageversion(settings["PORTDIR"], settings["ROOT"], settings.profile_path, settings["CHOST"], trees[settings["ROOT"]]["vartree"].dbapi) + header_width = 65 + header_title = "System Settings" if myfiles: - print "=================================================================" - print " System Settings" - print "=================================================================" + print header_width * "=" + print header_title.rjust(int(header_width/2 + len(header_title)/2)) + print header_width * "=" print "System uname: "+unameout if os.path.exists("/etc/gentoo-release"): os.system("cat /etc/gentoo-release") @@ -3116,9 +3118,10 @@ def action_info(settings, trees, myopts, myfiles): # If we have not yet printed the header, # print it now if not header_printed: - print "=================================================================" - print " Package Settings" - print "=================================================================" + header_title = "Package Settings" + print header_width * "=" + print header_title.rjust(int(header_width/2 + len(header_title)/2)) + print header_width * "=" header_printed = True # Print package info