OXIESEC PANEL
- Current Dir:
/
/
usr
/
lib
/
python3
/
dist-packages
/
numpy
/
distutils
Server IP: 139.59.38.164
Upload:
Create Dir:
Name
Size
Modified
Perms
📁
..
-
10/28/2024 08:45:52 AM
rwxr-xr-x
📄
__config__.py
1.73 KB
12/05/2017 02:32:02 PM
rw-r--r--
📄
__init__.py
747 bytes
09/17/2017 01:29:38 PM
rw-r--r--
📁
__pycache__
-
10/28/2024 08:45:52 AM
rwxr-xr-x
📄
__version__.py
151 bytes
09/17/2017 01:29:38 PM
rw-r--r--
📄
ccompiler.py
27.87 KB
09/29/2017 05:31:46 PM
rw-r--r--
📁
command
-
10/28/2024 08:45:52 AM
rwxr-xr-x
📄
compat.py
218 bytes
09/17/2017 01:29:38 PM
rw-r--r--
📄
conv_template.py
9.48 KB
09/17/2017 01:29:38 PM
rw-r--r--
📄
core.py
7.99 KB
09/17/2017 01:29:38 PM
rw-r--r--
📄
cpuinfo.py
22.45 KB
09/29/2017 05:31:46 PM
rw-r--r--
📄
environment.py
2.29 KB
09/17/2017 01:29:38 PM
rw-r--r--
📄
exec_command.py
8.46 KB
09/17/2017 01:29:38 PM
rw-r--r--
📄
extension.py
2.9 KB
09/17/2017 01:29:38 PM
rw-r--r--
📁
fcompiler
-
10/28/2024 08:45:52 AM
rwxr-xr-x
📄
from_template.py
7.65 KB
09/17/2017 01:29:38 PM
rw-r--r--
📄
info.py
157 bytes
09/17/2017 01:29:38 PM
rw-r--r--
📄
intelccompiler.py
4.19 KB
09/24/2017 10:47:22 PM
rw-r--r--
📄
lib2def.py
3.43 KB
09/17/2017 01:29:38 PM
rw-r--r--
📄
line_endings.py
2 KB
09/17/2017 01:29:38 PM
rw-r--r--
📄
log.py
2.68 KB
09/17/2017 01:29:38 PM
rw-r--r--
📁
mingw
-
10/28/2024 08:45:52 AM
rwxr-xr-x
📄
mingw32ccompiler.py
24.56 KB
09/24/2017 10:47:22 PM
rw-r--r--
📄
misc_util.py
80.05 KB
09/29/2017 05:31:46 PM
rw-r--r--
📄
msvc9compiler.py
2.21 KB
09/17/2017 01:29:38 PM
rw-r--r--
📄
msvccompiler.py
1.94 KB
09/17/2017 01:29:38 PM
rw-r--r--
📄
npy_pkg_config.py
12.93 KB
09/17/2017 01:29:38 PM
rw-r--r--
📄
numpy_distribution.py
700 bytes
09/17/2017 01:29:38 PM
rw-r--r--
📄
pathccompiler.py
779 bytes
09/17/2017 01:29:38 PM
rw-r--r--
📄
setup.py
611 bytes
09/17/2017 01:29:38 PM
rw-r--r--
📄
system_info.py
83.31 KB
09/29/2017 05:31:46 PM
rw-r--r--
📁
tests
-
10/28/2024 08:45:52 AM
rwxr-xr-x
📄
unixccompiler.py
5.04 KB
09/17/2017 01:29:38 PM
rw-r--r--
Editing: line_endings.py
Close
""" 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])