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

James Antill james at osuosl.org
Wed Dec 17 08:36:24 UTC 2008


 yum/i18n.py |    6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

New commits:
commit 262ea826b84256f5f0336b5272c7f647257b8375
Author: James Antill <james at and.org>
Date:   Wed Dec 17 03:35:40 2008 -0500

    Deal with blank lines after lists

diff --git a/yum/i18n.py b/yum/i18n.py
index fce5300..af70881 100755
--- a/yum/i18n.py
+++ b/yum/i18n.py
@@ -328,15 +328,17 @@ def utf8_text_wrap(text, width=70, initial_indent='', subsequent_indent=''):
         force_nl = False # We want to stop wrapping under "certain" conditions:
         if wrap_last and cspc_indent:      # if line starts a list or
             force_nl = True
+        if wrap_last and csab == len(line):# is empty line
+            force_nl = True
         if wrap_last and not lspc_indent:  # if line doesn't continue a list and
-            if csab == len(line):          # is empty line
-                force_nl = True
             if csab >= 4 and csab != lsab: # is "block indented"
                 force_nl = True
         if force_nl:
             ret.append(indent.rstrip(' '))
             indent = subsequent_indent
             wrap_last = False
+        if csab == len(line): # empty line, remove spaces to make it easier.
+            line = ''
         if wrap_last:
             line = line.lstrip(' ')
             cspc_indent = lspc_indent


More information about the Yum-commits mailing list