| Server IP : 127.0.0.1 / Your IP : 216.73.216.109 Web Server : Apache/2.4.54 (Win64) OpenSSL/1.1.1q PHP/8.1.10 System : Windows NT DESKTOP-E5T4RUN 10.0 build 19045 (Windows 10) AMD64 User : SERVERWEB ( 0) PHP Version : 8.1.10 Disable Function : NONE MySQL : OFF | cURL : ON | WGET : OFF | Perl : OFF | Python : OFF | Sudo : OFF | Pkexec : OFF Directory : C:/cygwin64/lib/python3.6/site-packages/pip/_vendor/pep517/__pycache__/ |
Upload File : |
3
�N�ai � @ sZ d dl Z d dlZd dlZd dlZd dlZd dlZd dlZejdd� �Zdd� Z dd� Z
dS )� Nc c s$ t j� } z
| V W dtj| � X dS )z2Create a temporary directory in a context manager.N)�tempfileZmkdtemp�shutilZrmtree)Ztd� r �/usr/lib/python3.6/dirtools.py�tempdir
s
r c O sB yt j| |�S tk
r< } z|jtjkr,� W Y dd}~X nX dS )zWLike `mkdir`, but does not raise an exception if the
directory already exists.
N)�os�mkdir�OSError�errnoZEEXIST)�args�kwargs�excr r r �mkdir_p s
r c C s� t j� }tj|d�}x�tj| �D ]z\} }}x8|D ]0}tjj| |�}tjj|| �}|j |d d� q0W x4|D ],}tjj| |�}tjj|| �}|j
||� qjW q W |S )z0Construct an in-memory zip file for a directory.�w�/� )�io�BytesIO�zipfileZZipFiler �walk�path�join�relpathZwritestr�write)�root�bufferZzip_file�dirs�filesr Zfs_pathZrel_pathr r r �dir_to_zipfile s
r )r r �
contextlibr r r
r �contextmanagerr r r r r r r �<module> s