관리-도구
편집 파일: context.cpython-311.pyc
� N�Dg$ � �| � d dl Z d dlZd dlZd dlZd dlZd dlZd dlZd dlZej d� � � Z ej dde fd�� � Z d� Zej ej fd�� � Z ej dde fd�� � Zej d� � � Z G d � d � � Z G d� dej ej � � Z G d � dej � � ZdS )� Nc # � K � t j � � }t j | � � | V � t j |� � dS # t j |� � w xY w)z� >>> tmp_path = getfixture('tmp_path') >>> with pushd(tmp_path): ... assert os.getcwd() == os.fspath(tmp_path) >>> assert os.getcwd() != os.fspath(tmp_path) N)�os�getcwd�chdir)�dir�origs ��/builddir/build/BUILD/imunify360-venv-2.4.0/opt/imunify360/venv/lib/python3.11/site-packages/setuptools/_vendor/jaraco/context.py�pushdr sQ � � � � �9�;�;�D��H�S�M�M�M��� � � � ������������������s �A �Ac # �� K � |�Gt j � | � � � dd� � � dd� � }|�!t j t j d�� � }nt j dt � � | dj di t � � ��� � d }d }d� ||f� � } | |j ddt | � � it � � ��� � ||� � 5 |V � ddd� � n# 1 swxY w Y | d j di t � � ��� � dS # | d j di t � � ��� � w xY w)z� Get a tarball, extract it, change to that directory, yield, then clean up. `runner` is the function to invoke commands. `pushd` is a context manager for changing the directory. Nz.tar.gz� z.tgzT)�shellzrunner parameter is deprecatedzmkdir {target_dir}zwget {url} -O -z7tar x{compression} --strip-components=1 -C {target_dir}z | �compressionzrm -Rf {target_dir}� )r �path�basename�replace� functools�partial� subprocess� check_call�warnings�warn�DeprecationWarning�format�vars�join�infer_compression)�url� target_dir�runnerr �getter�extract�cmds r �tarball_contextr$ s� � � � � ���W�%�%�c�*�*�2�2�9�b�A�A�I�I�&�RT�U�U� � �~��"�:�#8��E�E�E���� �6�8J�K�K�K� �F�&��&�0�0����0�0�1�1�1�7�"��K���j�j�&�'�*�+�+����z�s�z�G�G�&7��&<�&<�G����G�G�H�H�H� �U�:� � � � ����� � � � � � � � � � � ���� � � � � ��+�$�+�5�5�d�f�f�5�5�6�6�6�6�6����+�$�+�5�5�d�f�f�5�5�6�6�6�6���s1 �,AE �D�E �D�E �D�E �$E'c �f � | dd� }t ddd�� � }|� |d� � S )a Given a URL or filename, infer the compression code for tar. >>> infer_compression('http://foo/bar.tar.gz') 'z' >>> infer_compression('http://foo/bar.tgz') 'z' >>> infer_compression('file.bz') 'j' >>> infer_compression('file.xz') 'J' ���N�z�j�J)�gz�bz�xz)�dict�get)r �compression_indicator�mappings r r r : s; � � ����H���c�c�c�*�*�*�G��;�;�,�c�2�2�2� c # �p K � t j � � } |V � | |� � dS # | |� � w xY w)aN Create a temporary directory context. Pass a custom remover to override the removal behavior. >>> import pathlib >>> with temp_dir() as the_dir: ... assert os.path.isdir(the_dir) ... _ = pathlib.Path(the_dir).joinpath('somefile').write_text('contents') >>> assert not os.path.exists(the_dir) N)�tempfile�mkdtemp)�remover�temp_dirs r r6 r6 N sP � � � � ��!�!�H������������������������s �( � 5Tc # � K � d| v rdnd} |� � 5 }|d| |g}|r|� d|g� � t t j j d� � }|r|nd}t j ||�� � |V � ddd� � dS # 1 swxY w Y dS )z� Check out the repo indicated by url. If dest_ctx is supplied, it should be a context manager to yield the target directory for the check out. �git�hg�clonez--branch�wN)�stdout)�extend�openr r �devnullr r ) r �branch�quiet�dest_ctx�exe�repo_dirr# r? r<