diff options
author | Zac Medico <zmedico@gentoo.org> | 2006-07-15 07:15:27 +0000 |
---|---|---|
committer | Zac Medico <zmedico@gentoo.org> | 2006-07-15 07:15:27 +0000 |
commit | da439471c5adfc402290657ad338f557b8f4a181 (patch) | |
tree | 8633107f03ba14bac7c92f63c9470ffa4b1aec1e | |
parent | aa9bd14e4e796fa28d45e5219f9fc79053a6177d (diff) | |
download | portage-da439471c5adfc402290657ad338f557b8f4a181.tar.gz portage-da439471c5adfc402290657ad338f557b8f4a181.tar.bz2 portage-da439471c5adfc402290657ad338f557b8f4a181.zip |
Use calculations to center --info header titles.
svn path=/main/trunk/; revision=3881
-rwxr-xr-x | bin/emerge | 15 |
1 files changed, 9 insertions, 6 deletions
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 |