Файловый менеджер - Редактировать - /home/digitalm/venv/lib/python3.7/site-packages/setuptools/_vendor/jaraco/__pycache__/context.cpython-37.pyc
Назад
B �5�g$ � @ s� d dl Z d dlZd dlZd dlZd dlZd dlZd dlZd dlZejdd� �Z ejdde fdd��Z dd� Zejejfdd ��Z ejdd e fdd��Zejd d� �ZG dd� d�ZG dd� dejej�ZG dd� dej�ZdS )� Nc c s. t �� }t �| � z | V W dt �|� X dS )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�orig� r �I/tmp/pip-install-251nq386/setuptools/setuptools/_vendor/jaraco/context.py�pushd s r c c s� |dkr$t j�| ��dd��dd�}|dkr>tjtjdd�}nt� dt � |djf t� �� zRd }d }d� ||f�}||jf dt| �it� ��� ||�� |V W dQ R X W d|d jf t� �� X dS )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_dirZrunnerr �getter�extract�cmdr r r �tarball_context s r c C s&