/usr/share/cagefs-skeleton/opt/cloudlinux/venv/lib/python3.11/site-packages/numpy/distutils
""" Functions for converting from DOS to UNIX line endings """ import os import re import sys def dos2unix(file): "Replace CRLF with LF in argument files. Print names of changed files." if os.path.isdir(file): print(file, "Directory!") return with open(file, "rb") as fp: data = fp.read() if '\0' in data: print(file, "Binary!") return newdata = re.sub("\r\n", "\n", data) if newdata != data: print('dos2unix:', file) with open(file, "wb") as f: f.write(newdata) return file else: print(file, 'ok') def dos2unix_one_dir(modified_files, dir_name, file_names): for file in file_names: full_path = os.path.join(dir_name, file) file = dos2unix(full_path) if file is not None: modified_files.append(file) def dos2unix_dir(dir_name): modified_files = [] os.path.walk(dir_name, dos2unix_one_dir, modified_files) return modified_files #---------------------------------- def unix2dos(file): "Replace LF with CRLF in argument files. Print names of changed files." if os.path.isdir(file): print(file, "Directory!") return with open(file, "rb") as fp: data = fp.read() if '\0' in data: print(file, "Binary!") return newdata = re.sub("\r\n", "\n", data) newdata = re.sub("\n", "\r\n", newdata) if newdata != data: print('unix2dos:', file) with open(file, "wb") as f: f.write(newdata) return file else: print(file, 'ok') def unix2dos_one_dir(modified_files, dir_name, file_names): for file in file_names: full_path = os.path.join(dir_name, file) unix2dos(full_path) if file is not None: modified_files.append(file) def unix2dos_dir(dir_name): modified_files = [] os.path.walk(dir_name, unix2dos_one_dir, modified_files) return modified_files if __name__ == "__main__": dos2unix_dir(sys.argv[1])
.
Edit
..
Edit
__config__.py
Edit
__init__.py
Edit
__init__.pyi
Edit
__pycache__
Edit
_shell_utils.py
Edit
armccompiler.py
Edit
ccompiler.py
Edit
ccompiler_opt.py
Edit
checks
Edit
command
Edit
conv_template.py
Edit
core.py
Edit
cpuinfo.py
Edit
exec_command.py
Edit
extension.py
Edit
fcompiler
Edit
from_template.py
Edit
fujitsuccompiler.py
Edit
intelccompiler.py
Edit
lib2def.py
Edit
line_endings.py
Edit
log.py
Edit
mingw
Edit
mingw32ccompiler.py
Edit
misc_util.py
Edit
msvc9compiler.py
Edit
msvccompiler.py
Edit
npy_pkg_config.py
Edit
numpy_distribution.py
Edit
pathccompiler.py
Edit
setup.py
Edit
system_info.py
Edit
tests
Edit
unixccompiler.py
Edit