관리-도구
편집 파일: tempdirectory.cpython-311.pyc
� �܋f�3 � �� � d dl Z d dlZd dlZd dlmZ d dlmZ d dlmZ d dl m Z mZmZm Z mZ d dlmZ d dlmZ dd lmZ e ee e f Zerd dlZ G d � d� � Zdeegef fd �ZdS )� N)�Path)�compile)�mkdtemp)�Union�Sequence� TYPE_CHECKING�Tuple�Callable)�compare)�wrap� )�rmtreec �� � e Zd ZdZ e� � ZdZdZ d%dddd�dee e df dee d ed e fd�Z ed� � � Zd&d�Zd'd�Zed'd�� � Z d(dedededefd�Zd)dedefd�Z d*dee dedededef d�Zd� Zdefd�Zd%dedeee f d e fd�Zd%dee ee f d e fd�ZeZd%ded e fd �Zd%ded dfd!�Zd%ded e d eee f fd"�Zd#� Z d$� Z!dS )+� TempDirectoryad A class representing a temporary directory on disk. :param ignore: A sequence of strings containing regular expression patterns that match filenames that should be ignored by the :class:`TempDirectory` listing and checking methods. :param create: If `True`, the temporary directory will be created as part of class instantiation. :param path: If passed, this should be a string containing an absolute path to use as the temporary directory. When passed, :class:`TempDirectory` will not create a new directory to use. :param encoding: A default encoding to use for :meth:`read` and :meth:`write` operations when the ``encoding`` parameter is not passed to those methods. FN� )�ignore�create�encoding�pathz py.path.localr r r c � � g | _ |D ])}| j � t |� � � � �*|rt |� � nd | _ || _ t |� � | _ |s|�|�| � � � d S d S d S �N) r �appendr �strr r �bool�dont_remover )�selfr r r r �regexs �k/builddir/build/BUILD/cloudlinux-venv-1.0.6/venv/lib/python3.11/site-packages/testfixtures/tempdirectory.py�__init__zTempDirectory.__init__3 s� � � ���� /� /�E��K���w�u�~�~�.�.�.�.�!%�/�C��I�I�I�4�� � �� ���:�:���� �d�l�v�~��K�K�M�M�M�M�M� #�l�~�~� c � � | j r;t j dd� d� | j D � � � � z � � d S d S )Nz6TempDirectory instances not cleaned up by shutdown: %s� c 3 �$ K � | ]}|j V � �d S r )r )�.0�is r � <genexpr>z'TempDirectory.atexit.<locals>.<genexpr>I s$ � � � �!@�!@�Q�!�&�!@�!@�!@�!@�!@�!@r )� instances�warnings�warn�join)�clss r �atexitzTempDirectory.atexitD s_ � ��=� ��M��� � �!@�!@�#�-�!@�!@�!@�@�@�B� � � � � � � r �returnc �� � | j r| S t � � | _ | j � | � � | j j s%t j | j � � d| j _ | S )zt Create a temporary directory for this instance to use if one has not already been created. T)r r r'