[Python-checkins] CVS: python/dist/src/Lib string.py,1.46,1.47

Fred L. Drake fdrake@weyr.cnri.reston.va.us
2000年2月10日 11:21:13 -0500 (EST)


Update of /projects/cvsroot/python/dist/src/Lib
In directory weyr:/home/fdrake/projects/python/Lib
Modified Files:
	string.py 
Log Message:
Detabify.
I ran "expand" instead of using Skip's patch, but it's all the same.
Index: string.py
===================================================================
RCS file: /projects/cvsroot/python/dist/src/Lib/string.py,v
retrieving revision 1.46
retrieving revision 1.47
diff -C2 -r1.46 -r1.47
*** string.py	2000年02月04日 15:28:41	1.46
--- string.py	2000年02月10日 16:21:11	1.47
***************
*** 198,205 ****
 """
 if type(s) == _StringType:
! 	return _float(s)
 else:
! 	raise TypeError('argument 1: expected string, %s found' %
! 			type(s).__name__)
 
 # Convert string to integer
--- 198,205 ----
 """
 if type(s) == _StringType:
! return _float(s)
 else:
! raise TypeError('argument 1: expected string, %s found' %
! type(s).__name__)
 
 # Convert string to integer
***************
*** 216,231 ****
 """
 try:
! 	s = args[0]
 except IndexError:
! 	raise TypeError('function requires at least 1 argument: %d given' %
! 			len(args))
 # Don't catch type error resulting from too many arguments to int(). The
 # error message isn't compatible but the error type is, and this function
 # is complicated enough already.
 if type(s) == _StringType:
! 	return _apply(_int, args)
 else:
! 	raise TypeError('argument 1: expected string, %s found' %
! 			type(s).__name__)
 
 
--- 216,231 ----
 """
 try:
! s = args[0]
 except IndexError:
! raise TypeError('function requires at least 1 argument: %d given' %
! len(args))
 # Don't catch type error resulting from too many arguments to int(). The
 # error message isn't compatible but the error type is, and this function
 # is complicated enough already.
 if type(s) == _StringType:
! return _apply(_int, args)
 else:
! raise TypeError('argument 1: expected string, %s found' %
! type(s).__name__)
 
 
***************
*** 244,259 ****
 """
 try:
! 	s = args[0]
 except IndexError:
! 	raise TypeError('function requires at least 1 argument: %d given' %
! 			len(args))
 # Don't catch type error resulting from too many arguments to long(). The
 # error message isn't compatible but the error type is, and this function
 # is complicated enough already.
 if type(s) == _StringType:
! 	return _apply(_long, args)
 else:
! 	raise TypeError('argument 1: expected string, %s found' %
! 			type(s).__name__)
 
 
--- 244,259 ----
 """
 try:
! s = args[0]
 except IndexError:
! raise TypeError('function requires at least 1 argument: %d given' %
! len(args))
 # Don't catch type error resulting from too many arguments to long(). The
 # error message isn't compatible but the error type is, and this function
 # is complicated enough already.
 if type(s) == _StringType:
! return _apply(_long, args)
 else:
! raise TypeError('argument 1: expected string, %s found' %
! type(s).__name__)
 
 
***************
*** 297,302 ****
 half = n/2
 if n%2 and width%2:
! 	# This ensures that center(center(s, i), j) = center(s, j)
! 	half = half+1
 return ' '*half + s + ' '*(n-half)
 
--- 297,302 ----
 half = n/2
 if n%2 and width%2:
! # This ensures that center(center(s, i), j) = center(s, j)
! half = half+1
 return ' '*half + s + ' '*(n-half)
 
***************
*** 317,321 ****
 sign = ''
 if s[0] in ('-', '+'):
! 	sign, s = s[0], s[1:]
 return sign + '0'*(width-n) + s
 
--- 317,321 ----
 sign = ''
 if s[0] in ('-', '+'):
! sign, s = s[0], s[1:]
 return sign + '0'*(width-n) + s
 
***************
*** 332,341 ****
 res = line = ''
 for c in s:
! 	if c == '\t':
! 	 c = ' '*(tabsize - len(line) % tabsize)
! 	line = line + c
! 	if c == '\n':
! 	 res = res + line
! 	 line = ''
 return res + line
 
--- 332,341 ----
 res = line = ''
 for c in s:
! if c == '\t':
! c = ' '*(tabsize - len(line) % tabsize)
! line = line + c
! if c == '\n':
! res = res + line
! line = ''
 return res + line
 
***************
*** 386,397 ****
 """
 if len(fromstr) != len(tostr):
! 	raise ValueError, "maketrans arguments must have same length"
 global _idmapL
 if not _idmapL:
! 	_idmapL = map(None, _idmap)
 L = _idmapL[:]
 fromstr = map(ord, fromstr)
 for i in range(len(fromstr)):
! 	L[fromstr[i]] = tostr[i]
 return joinfields(L, "")
 
--- 386,397 ----
 """
 if len(fromstr) != len(tostr):
! raise ValueError, "maketrans arguments must have same length"
 global _idmapL
 if not _idmapL:
! _idmapL = map(None, _idmap)
 L = _idmapL[:]
 fromstr = map(ord, fromstr)
 for i in range(len(fromstr)):
! L[fromstr[i]] = tostr[i]
 return joinfields(L, "")
 
***************
*** 427,429 ****
 letters = lowercase + uppercase
 except ImportError:
! pass					 # Use the original versions
--- 427,429 ----
 letters = lowercase + uppercase
 except ImportError:
! pass # Use the original versions

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