diff babel/messages/pofile.py @ 316:3d67cf6d8022 stable-0.9.x

Ported [349] to 0.9.x branch.
author cmlenz
date Fri, 01 Feb 2008 15:25:20 +0000
parents fc1fcf6b002c
children aa8457401353 c2ae38340540
line wrap: on
line diff
--- a/babel/messages/pofile.py
+++ b/babel/messages/pofile.py
@@ -25,11 +25,10 @@
     set
 except NameError:
     from sets import Set as set
-from textwrap import wrap
 
 from babel import __version__ as VERSION
 from babel.messages.catalog import Catalog, Message
-from babel.util import LOCALTZ
+from babel.util import wraptext, LOCALTZ
 
 __all__ = ['read_po', 'write_po']
 __docformat__ = 'restructuredtext en'
@@ -370,7 +369,7 @@
     def _write_comment(comment, prefix=''):
         lines = comment
         if width and width > 0:
-            lines = wrap(comment, width, break_long_words=False)
+            lines = wraptext(comment, width)
         for line in lines:
             _write('#%s %s\n' % (prefix, line.strip()))
 
@@ -404,8 +403,8 @@
             if width and width > 0:
                 lines = []
                 for line in comment_header.splitlines():
-                    lines += wrap(line, width=width, subsequent_indent='# ',
-                                  break_long_words=False)
+                    lines += wraptext(line, width=width,
+                                      subsequent_indent='# ')
                 comment_header = u'\n'.join(lines) + u'\n'
             _write(comment_header)
 
Copyright (C) 2012-2017 Edgewall Software