X7ROOT File Manager
Current Path:
/opt/alt/python27/lib/python2.7/site-packages/pip/_vendor/pep517
opt
/
alt
/
python27
/
lib
/
python2.7
/
site-packages
/
pip
/
_vendor
/
pep517
/
??
..
??
__init__.py
(84 B)
??
__init__.pyc
(336 B)
??
_in_process.py
(8.24 KB)
??
_in_process.pyc
(12.2 KB)
??
build.py
(3.26 KB)
??
build.pyc
(4.73 KB)
??
check.py
(5.82 KB)
??
check.pyc
(6.27 KB)
??
colorlog.py
(4 KB)
??
colorlog.pyc
(3.98 KB)
??
compat.py
(780 B)
??
compat.pyc
(1.74 KB)
??
dirtools.py
(1.1 KB)
??
dirtools.pyc
(1.96 KB)
??
envbuild.py
(5.9 KB)
??
envbuild.pyc
(5.94 KB)
??
meta.py
(2.41 KB)
??
meta.pyc
(3.9 KB)
??
wrappers.py
(10.53 KB)
??
wrappers.pyc
(14.54 KB)
Editing: dirtools.py
import os import io import contextlib import tempfile import shutil import errno import zipfile @contextlib.contextmanager def tempdir(): """Create a temporary directory in a context manager.""" td = tempfile.mkdtemp() try: yield td finally: shutil.rmtree(td) def mkdir_p(*args, **kwargs): """Like `mkdir`, but does not raise an exception if the directory already exists. """ try: return os.mkdir(*args, **kwargs) except OSError as exc: if exc.errno != errno.EEXIST: raise def dir_to_zipfile(root): """Construct an in-memory zip file for a directory.""" buffer = io.BytesIO() zip_file = zipfile.ZipFile(buffer, 'w') for root, dirs, files in os.walk(root): for path in dirs: fs_path = os.path.join(root, path) rel_path = os.path.relpath(fs_path, root) zip_file.writestr(rel_path + '/', '') for path in files: fs_path = os.path.join(root, path) rel_path = os.path.relpath(fs_path, root) zip_file.write(fs_path, rel_path) return zip_file
Upload File
Create Folder