summaryrefslogtreecommitdiff
path: root/numpy/distutils/line_endings.py
diff options
context:
space:
mode:
authorcookedm <cookedm@localhost>2006-03-10 21:31:27 +0000
committercookedm <cookedm@localhost>2006-03-10 21:31:27 +0000
commitbf57380caa818b73a4c41409de6ff260425f9bb6 (patch)
treeb2c42e0fde172de5def0c91811845808c00e296e /numpy/distutils/line_endings.py
parentf2db317c1fad63f1c85944ba8443b465e32774dc (diff)
downloadnumpy-bf57380caa818b73a4c41409de6ff260425f9bb6.tar.gz
Run reindent.py (script distributed with Python) over the source to remove extraneous whitespace
Diffstat (limited to 'numpy/distutils/line_endings.py')
-rw-r--r--numpy/distutils/line_endings.py16
1 files changed, 8 insertions, 8 deletions
diff --git a/numpy/distutils/line_endings.py b/numpy/distutils/line_endings.py
index 4f30af06a..65fe2d129 100644
--- a/numpy/distutils/line_endings.py
+++ b/numpy/distutils/line_endings.py
@@ -4,16 +4,16 @@
import sys, re, os
def dos2unix(file):
- "Replace CRLF with LF in argument files. Print names of changed files."
+ "Replace CRLF with LF in argument files. Print names of changed files."
if os.path.isdir(file):
print file, "Directory!"
return
-
+
data = open(file, "rb").read()
if '\0' in data:
print file, "Binary!"
return
-
+
newdata = re.sub("\r\n", "\n", data)
if newdata != data:
print 'dos2unix:', file
@@ -22,7 +22,7 @@ def dos2unix(file):
f.close()
return file
else:
- print file, 'ok'
+ print file, 'ok'
def dos2unix_one_dir(modified_files,dir_name,file_names):
for file in file_names:
@@ -38,11 +38,11 @@ def dos2unix_dir(dir_name):
#----------------------------------
def unix2dos(file):
- "Replace LF with CRLF in argument files. Print names of changed files."
+ "Replace LF with CRLF in argument files. Print names of changed files."
if os.path.isdir(file):
print file, "Directory!"
return
-
+
data = open(file, "rb").read()
if '\0' in data:
print file, "Binary!"
@@ -56,7 +56,7 @@ def unix2dos(file):
f.close()
return file
else:
- print file, 'ok'
+ print file, 'ok'
def unix2dos_one_dir(modified_files,dir_name,file_names):
for file in file_names:
@@ -69,7 +69,7 @@ def unix2dos_dir(dir_name):
modified_files = []
os.path.walk(dir_name,unix2dos_one_dir,modified_files)
return modified_files
-
+
if __name__ == "__main__":
import sys
dos2unix_dir(sys.argv[1])