관리-도구
편집 파일: spinner.cpython-38.pyc
U &?�f� � @ s d dl mZmZmZmZmZ ddlmZ ddlm Z ddl mZ ddlm Z ertddlmZmZmZmZ ddlmZ G d d � d �Zedk�rd dlmZ dd lmZ ddlmZ ddlmZ edd� ee� � �D �ddd�Z!eee!ddd�dd��Zed� q�W 5 Q R X dS )� )�cast�List�Optional� TYPE_CHECKING�Union� )�SPINNERS)�Measurement)�Table)�Text)�Console�ConsoleOptions�RenderResult�RenderableType)� StyleTypec @ s� e Zd ZdZdddd�eded edd�d d �Zddd d�dd�Zdde d�dd�Z edd�dd�Zdddd�ded ee dd�dd�ZdS )�Spinnera� A spinner animation. Args: name (str): Name of spinner (run python -m rich.spinner). text (RenderableType, optional): A renderable to display at the right of the spinner (str or Text typically). Defaults to "". style (StyleType, optional): Style for spinner animation. Defaults to None. speed (float, optional): Speed factor for animation. Defaults to 1.0. Raises: KeyError: If name isn't one of the supported spinner animations. � Ng �?)�style�speedr r )�name�textr r �returnc C s� zt | }W n" tk r. td|����Y nX t|t�rDt�|�n|| _ttt |d �d d � | _ tt |d �| _d | _|| _ || _d| _d| _d S )Nzno spinner called �frames�interval� )r �KeyError� isinstance�strr �from_markupr r r r �floatr � start_timer r �frame_no_offset� _update_speed)�selfr r r r �spinner� r% �F/opt/hc_python/lib/python3.8/site-packages/pip/_vendor/rich/spinner.py�__init__ s �zSpinner.__init__r r r )�console�optionsr c c s | � |�� �V d S )N)�render�get_time)r# r( r) r% r% r&