OXIESEC PANEL
- Current Dir:
/
/
opt
/
alt
/
python37
/
lib
/
python3.7
/
site-packages
/
pip
/
_vendor
/
pep517
Server IP: 2a02:4780:11:1084:0:327f:3464:10
Upload:
Create Dir:
Name
Size
Modified
Perms
📁
..
-
02/16/2024 09:01:52 PM
rwxr-xr-x
📄
__init__.py
84 bytes
11/13/2023 09:31:06 PM
rw-r--r--
📁
__pycache__
-
02/16/2024 09:01:52 PM
rwxr-xr-x
📄
_in_process.py
8.24 KB
11/13/2023 09:31:06 PM
rw-r--r--
📄
build.py
3.26 KB
11/13/2023 09:31:06 PM
rw-r--r--
📄
check.py
5.82 KB
11/13/2023 09:31:06 PM
rw-r--r--
📄
colorlog.py
4 KB
11/13/2023 09:31:06 PM
rw-r--r--
📄
compat.py
780 bytes
11/13/2023 09:31:06 PM
rw-r--r--
📄
dirtools.py
1.1 KB
11/13/2023 09:31:06 PM
rw-r--r--
📄
envbuild.py
5.9 KB
11/13/2023 09:31:06 PM
rw-r--r--
📄
meta.py
2.41 KB
11/13/2023 09:31:06 PM
rw-r--r--
📄
wrappers.py
10.53 KB
11/13/2023 09:31:06 PM
rw-r--r--
Editing: dirtools.py
Close
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