golden hour
/opt/saltstack/salt/lib/python3.10/site-packages/pkg_resources/_vendor/jaraco/__pycache__
⬆️ Go Up
Upload
File/Folder
Size
Actions
__init__.cpython-310.pyc
182 B
Del
OK
context.cpython-310.pyc
8.3 KB
Del
OK
functools.cpython-310.pyc
16.79 KB
Del
OK
Edit: context.cpython-310.pyc
o �xe$ � @ 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 s8 � t �� }t �| � z| V W t �|� dS t �|� 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�orig� r �X/opt/saltstack/salt/lib/python3.10/site-packages/pkg_resources/_vendor/jaraco/context.py�pushd s � r c c s � |du rt j�| ��dd��dd�}|du r tjtjdd�}nt� dt � |djdi t� ��� zMd }d }d� ||f�}||jddt| �it� ��� ||�� |V W d � n1 s^w Y W |d jdi t� ��� dS W |d jdi t� ��� dS |d jdi t� ��� 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 )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$ � ��2r c C s&