Hackfut Security File Manager
Current Path:
/opt/alt/python37/lib64/python3.7/site-packages/numpy/distutils
opt
/
alt
/
python37
/
lib64
/
python3.7
/
site-packages
/
numpy
/
distutils
/
📁
..
📄
__config__.py
(1.74 KB)
📄
__init__.py
(747 B)
📁
__pycache__
📄
__version__.py
(151 B)
📄
ccompiler.py
(27.87 KB)
📁
command
📄
compat.py
(218 B)
📄
conv_template.py
(9.46 KB)
📄
core.py
(7.99 KB)
📄
cpuinfo.py
(22.43 KB)
📄
environment.py
(2.29 KB)
📄
exec_command.py
(8.46 KB)
📄
extension.py
(2.9 KB)
📁
fcompiler
📄
from_template.py
(7.63 KB)
📄
info.py
(157 B)
📄
intelccompiler.py
(4.19 KB)
📄
lib2def.py
(3.43 KB)
📄
line_endings.py
(2 KB)
📄
log.py
(2.68 KB)
📁
mingw
📄
mingw32ccompiler.py
(24.56 KB)
📄
misc_util.py
(80.05 KB)
📄
msvc9compiler.py
(2.21 KB)
📄
msvccompiler.py
(1.94 KB)
📄
npy_pkg_config.py
(12.93 KB)
📄
numpy_distribution.py
(700 B)
📄
pathccompiler.py
(779 B)
📄
setup.py
(589 B)
📄
site.cfg
(174 B)
📄
system_info.py
(83.28 KB)
📁
tests
📄
unixccompiler.py
(5.04 KB)
Editing: line_endings.py
""" Functions for converting from DOS to UNIX line endings """ from __future__ import division, absolute_import, print_function import sys, re, os def dos2unix(file): "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) f = open(file, "wb") f.write(newdata) f.close() 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 data = open(file, "rb").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) f = open(file, "wb") f.write(newdata) f.close() 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])
Upload File
Create Folder