[yum-commits] Branch 'yum-3_2_X' - 2 commits - yum/i18n.py yumcommands.py

James Antill james at osuosl.org
Sun Nov 2 05:25:40 UTC 2008


 yum/i18n.py    |    4 ++--
 yumcommands.py |   11 +++++++----
 2 files changed, 9 insertions(+), 6 deletions(-)

New commits:
commit 809f033c400b124668f74b44834cf71a76a4fe13
Author: James Antill <james at and.org>
Date:   Sun Nov 2 01:25:11 2008 -0400

    Fix stupid typo in port of utf8_width, all 2 pair sequences were seen as bad

diff --git a/yum/i18n.py b/yum/i18n.py
index 27dcc62..b1632ca 100755
--- a/yum/i18n.py
+++ b/yum/i18n.py
@@ -165,8 +165,8 @@ def __utf8_iter_ucs(msg):
             yield (byte0, 1)
         elif (byte0 & 0xe0) == 0xc0: # 110XXXXx 10xxxxxx
             byte1 = uiter.next()
-            if (((byte0 & 0xc0) != 0x80) or 
-                ((byte1 & 0xfe) == 0xc0)):                          # overlong?
+            if (((byte1 & 0xc0) != 0x80) or
+                ((byte0 & 0xfe) == 0xc0)):                          # overlong?
                 yield (None, 2)
                 return
             yield ((((byte0 & 0x1f) << 6) | (byte1 & 0x3f)), 2)
commit 523e8f7c8332bb1e6ee3925cc0d0b61d2750c12f
Author: James Antill <james at and.org>
Date:   Sun Nov 2 01:12:23 2008 -0400

    Make the width of enabled/disable in repolist, correct for i18n

diff --git a/yumcommands.py b/yumcommands.py
index 66468ec..7b0214f 100644
--- a/yumcommands.py
+++ b/yumcommands.py
@@ -29,7 +29,7 @@ import locale
 import fnmatch
 import time
 from yum.misc import to_unicode
-from yum.i18n import utf8_width_fill
+from yum.i18n import utf8_width, utf8_width_fill
 
 def checkRootUID(base):
     """
@@ -751,6 +751,9 @@ class RepoListCommand(YumCommand):
                 ui_enabled = dhibeg + _('disabled') + hiend
                 ui_num     = ""
                 ui_fmt_num = "%s"
+            ui_endis_wid = utf8_width(_('disabled'))
+            if ui_endis_wid < utf8_width(_('enabled')):
+                ui_endis_wid = utf8_width(_('enabled'))
                 
             if (arg == 'all' or
                 (arg == 'enabled' and enabled) or
@@ -759,14 +762,14 @@ class RepoListCommand(YumCommand):
                     if not done:
                         txt_rid  = utf8_width_fill(_('repo id'), 20, 20)
                         txt_rnam = utf8_width_fill(_('repo name'), 40, 40)
-                        txt_stat = utf8_width_fill(_('status'), 8)
                         base.verbose_logger.log(logginglevels.INFO_2,"%s %s %s",
-                                                txt_rid, txt_rnam, txt_stat)
+                                                txt_rid, txt_rnam, _('status'))
                         done = True
                     base.verbose_logger.log(logginglevels.INFO_2, "%s %s %s%s",
                                             utf8_width_fill(str(repo), 20, 20),
                                             utf8_width_fill(repo.name, 40, 40),
-                                            utf8_width_fill(ui_enabled, 8),
+                                            utf8_width_fill(ui_enabled,
+                                                            ui_endis_wid),
                                             ui_fmt_num % ui_num)
                 else:
                     md = repo.repoXML


More information about the Yum-commits mailing list