OXIESEC PANEL
- Current Dir:
/
/
var
/
www
/
cream
/
reader
/
venv
/
lib
/
python3.6
/
site-packages
/
pip
/
_vendor
/
pep517
Server IP: 139.59.38.164
Upload:
Create Dir:
Name
Size
Modified
Perms
📁
..
-
03/03/2025 08:48:37 AM
rwxr-xr-x
📄
__init__.py
130 bytes
03/03/2025 08:48:35 AM
rw-r--r--
📄
build.py
3.38 KB
03/03/2025 08:48:34 AM
rw-r--r--
📄
check.py
5.94 KB
03/03/2025 08:48:34 AM
rw-r--r--
📄
colorlog.py
4 KB
03/03/2025 08:48:35 AM
rw-r--r--
📄
compat.py
1.22 KB
03/03/2025 08:48:35 AM
rw-r--r--
📄
dirtools.py
1.1 KB
03/03/2025 08:48:35 AM
rw-r--r--
📄
envbuild.py
5.96 KB
03/03/2025 08:48:35 AM
rw-r--r--
📁
in_process
-
03/03/2025 09:04:56 AM
rwxr-xr-x
📄
meta.py
2.41 KB
03/03/2025 08:48:35 AM
rw-r--r--
📄
wrappers.py
13.11 KB
03/03/2025 08:48:35 AM
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