[Python-checkins] python/dist/src/Lib textwrap.py,1.9,1.10
gward@users.sourceforge.net
gward@users.sourceforge.net
Mon, 10 Jun 2002 13:36:10 -0700
Update of /cvsroot/python/python/dist/src/Lib
In directory usw-pr-cvs1:/tmp/cvs-serv15481
Modified Files:
textwrap.py
Log Message:
Allow the standalone wrap() and fill() functions to take arbitrary
keyword args, which are passed directly to the TextWrapper constructor.
Index: textwrap.py
===================================================================
RCS file: /cvsroot/python/python/dist/src/Lib/textwrap.py,v
retrieving revision 1.9
retrieving revision 1.10
diff -C2 -d -r1.9 -r1.10
*** textwrap.py 10 Jun 2002 20:26:02 -0000 1.9
--- textwrap.py 10 Jun 2002 20:36:07 -0000 1.10
***************
*** 245,251 ****
# Convenience interface
! def wrap(text, width):
! return TextWrapper(width=width).wrap(text)
! def fill(text, width, initial_tab="", subsequent_tab=""):
! return TextWrapper(width=width).fill(text, initial_tab, subsequent_tab)
--- 245,253 ----
# Convenience interface
! def wrap(text, width=70, **kwargs):
! w = TextWrapper(width=width, **kwargs)
! return w.wrap(text)
! def fill(text, width=70, initial_tab="", subsequent_tab="", **kwargs):
! w = TextWrapper(width=width, **kwargs)
! return w.fill(text, initial_tab, subsequent_tab)