[Python-checkins] python/dist/src/Tools/scripts crlf.py,1.2,1.3

gvanrossum@users.sourceforge.net gvanrossum@users.sourceforge.net
Wed, 13 Nov 2002 13:04:35 -0800


Update of /cvsroot/python/python/dist/src/Tools/scripts
In directory usw-pr-cvs1:/tmp/cvs-serv1766

Modified Files:
	crlf.py 
Log Message:
Tim wins a bet.  Don't use re.


Index: crlf.py
===================================================================
RCS file: /cvsroot/python/python/dist/src/Tools/scripts/crlf.py,v
retrieving revision 1.2
retrieving revision 1.3
diff -C2 -d -r1.2 -r1.3
*** crlf.py	14 Feb 2000 21:42:14 -0000	1.2
--- crlf.py	13 Nov 2002 21:04:31 -0000	1.3
***************
*** 3,7 ****
  "Replace CRLF with LF in argument files.  Print names of changed files."
  
! import sys, re, os
  for file in sys.argv[1:]:
      if os.path.isdir(file):
--- 3,7 ----
  "Replace CRLF with LF in argument files.  Print names of changed files."
  
! import sys, os
  for file in sys.argv[1:]:
      if os.path.isdir(file):
***************
*** 12,16 ****
          print file, "Binary!"
          continue
!     newdata = re.sub("\r\n", "\n", data)
      if newdata != data:
          print file
--- 12,16 ----
          print file, "Binary!"
          continue
!     newdata = data.replace("\r\n", "\n")
      if newdata != data:
          print file