Use calculations to center --info header titles.
authorZac Medico <zmedico@gentoo.org>
Sat, 15 Jul 2006 07:15:27 +0000 (07:15 -0000)
committerZac Medico <zmedico@gentoo.org>
Sat, 15 Jul 2006 07:15:27 +0000 (07:15 -0000)
svn path=/main/trunk/; revision=3881

bin/emerge

index 2a2dea3edfc3f0019a0b4f80847825a8f08ffd69..3ddd61c2ad7bf96e699f3007bf93712e5bff55d1 100755 (executable)
@@ -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