관리-도구
편집 파일: progress_bars.cpython-36.pyc
3 �Re�# � @ s� d dl mZ d dlZd dlZd dlmZmZmZ d dlmZ d dl m Z mZmZ d dl mZ d dlmZ d dlmZ d d lmZ d d lmZ er�d dlmZmZmZ yd dlmZ W n ek r� dZY nX d d� Zeee �ZG dd� de�Z G dd� de �Z!G dd� de�Z"G dd� de�Z#G dd� de�Z$G dd� de$e e#�Z%G dd� de%e�Z&G dd� de%e!�Z'G dd � d e%e �Z(G d!d"� d"e%e�Z)G d#d$� d$e%e"�Z*G d%d&� d&e$e e#e�Z+e'e'fe&e+fe(e+fe)e+fe*e+fd'�Z,d*d(d)�Z-dS )+� )�divisionN)�SIGINT�default_int_handler�signal)�six)�Bar�FillingCirclesBar�IncrementalBar)�Spinner)�WINDOWS)�get_indentation)�format_size)�MYPY_CHECK_RUNNING)�Any�Dict�List)�coloramac C s� t | jdd �}|s|S t | dtj� �t | dtj� �g}|tt | dg ��7 }ytj� j|�j|� W n tk rv |S X | S d S )N�encoding� empty_fill�fill�phases)�getattr�filer � text_type�list�join�encode�UnicodeEncodeError)� preferred�fallbackr � characters� r! ��/builddir/build/BUILDROOT/alt-python36-pip-20.2.4-5.el8.x86_64/opt/alt/python36/lib/python3.6/site-packages/pip/_internal/cli/progress_bars.py�_select_progress_class s r# c s4 e Zd ZdZ� fdd�Z� fdd�Zdd� Z� ZS )�InterruptibleMixina� Helper to ensure that self.finish() gets called on keyboard interrupt. This allows downloads to be interrupted without leaving temporary state (like hidden cursors) behind. This class is similar to the progress library's existing SigIntMixin helper, but as of version 1.2, that helper has the following problems: 1. It calls sys.exit(). 2. It discards the existing SIGINT handler completely. 3. It leaves its own handler in place even after an uninterrupted finish, which will have unexpected delayed effects if the user triggers an unrelated keyboard interrupt some time after a progress-displaying download has already completed, for example. c s4 t t| �j||� tt| j�| _| jdkr0t| _dS )z= Save the original SIGINT handler for later. N)�superr$ �__init__r r � handle_sigint�original_handlerr )�self�args�kwargs)� __class__r! r"