[Python-checkins] python/dist/src/Lib textwrap.py,1.22,1.23

gward@users.sourceforge.net gward@users.sourceforge.net
2003年2月03日 06:47:01 -0800


Update of /cvsroot/python/python/dist/src/Lib
In directory sc8-pr-cvs1:/tmp/cvs-serv1030/Lib
Modified Files:
	textwrap.py 
Log Message:
Add __all__ (suggested by Raymond Hettinger).
Rename 'whitespace' global to '_whitespace' -- it's not part of the
public interface.
Index: textwrap.py
===================================================================
RCS file: /cvsroot/python/python/dist/src/Lib/textwrap.py,v
retrieving revision 1.22
retrieving revision 1.23
diff -C2 -d -r1.22 -r1.23
*** textwrap.py	12 Dec 2002 17:24:35 -0000	1.22
--- textwrap.py	3 Feb 2003 14:46:57 -0000	1.23
***************
*** 13,16 ****
--- 13,18 ----
 import string, re
 
+ __all__ = ['TextWrapper', 'wrap', 'fill']
+ 
 # Hardcode the recognized whitespace characters to the US-ASCII
 # whitespace characters. The main reason for doing this is that in
***************
*** 21,25 ****
 # *non-breaking* space), 2) possibly cause problems with Unicode,
 # since 0xa0 is not in range(128).
! whitespace = '\t\n\x0b\x0c\r '
 
 class TextWrapper:
--- 23,27 ----
 # *non-breaking* space), 2) possibly cause problems with Unicode,
 # since 0xa0 is not in range(128).
! _whitespace = '\t\n\x0b\x0c\r '
 
 class TextWrapper:
***************
*** 59,67 ****
 """
 
! whitespace_trans = string.maketrans(whitespace, ' ' * len(whitespace))
 
 unicode_whitespace_trans = {}
 uspace = ord(u' ')
! for x in map(ord, whitespace):
 unicode_whitespace_trans[x] = uspace
 
--- 61,69 ----
 """
 
! whitespace_trans = string.maketrans(_whitespace, ' ' * len(_whitespace))
 
 unicode_whitespace_trans = {}
 uspace = ord(u' ')
! for x in map(ord, _whitespace):
 unicode_whitespace_trans[x] = uspace
 

AltStyle によって変換されたページ (->オリジナル) /