/opt/imh-python/lib/python3.9/site-packages/numpy/distutils
NameSizeModeActions
checks/-0755rm
command/-0755rm
fcompiler/-0755rm
mingw/-0755rm
tests/-0755rm
__pycache__/-0755rm
armccompiler.py9620644editdlrm
ccompiler.py286180644editdlrm
ccompiler_opt.py1003350644editdlrm
conv_template.py95360644editdlrm
core.py81730644editdlrm
cpuinfo.py226390644editdlrm
exec_command.py102830644editdlrm
extension.py35680644editdlrm
from_template.py79130644editdlrm
fujitsuccompiler.py8340644editdlrm
intelccompiler.py42340644editdlrm
lib2def.py36300644editdlrm
line_endings.py20320644editdlrm
log.py28790644editdlrm
mingw32ccompiler.py220670644editdlrm
misc_util.py893590644editdlrm
msvc9compiler.py21920644editdlrm
msvccompiler.py26470644editdlrm
npy_pkg_config.py129720644editdlrm
numpy_distribution.py6340644editdlrm
pathccompiler.py7130644editdlrm
setup.py6340644editdlrm
system_info.py1139270644editdlrm
unixccompiler.py54260644editdlrm
_shell_utils.py26130644editdlrm
__init__.py20740644editdlrm
__init__.pyi1190644editdlrm
Edit: /opt/imh-python/lib/python3.9/site-packages/numpy/distutils/line_endings.py (2032B)
""" 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])