a
    ibòfI  ã                   @   s:  d dl mZ d dlmZmZ ddlmZmZ ddlm	Z	 ddl
mZ ddlmZ ddlmZ G d	d
„ d
e	ƒZedk�r6d dlmZ ddlmZ eƒ Ze d¡�|Zedƒ e d¡ edƒ e d¡ edƒ ejddd� edƒ e d¡ edƒ ejdddd� edƒ W d  ƒ n1 �s"0    Y  e d¡ dS )é    )ÚTracebackType)ÚOptionalÚTypeé   )ÚConsoleÚRenderableType)ÚJupyterMixin)ÚLive)ÚSpinner)Ú	StyleTypec                   @   sì   e Zd ZdZddddddœeee eee	e	dœd	d
„Z
eedœdd„ƒZeddœdd„ƒZd ddddœee ee ee ee	 ddœdd„Zddœdd„Zddœdd„Zedœdd„Zd dœdd„Zeee  ee ee ddœdd„ZdS )!ÚStatusa�  Displays a status indicator with a 'spinner' animation.

    Args:
        status (RenderableType): A status renderable (str or Text typically).
        console (Console, optional): Console instance to use, or None for global console. Defaults to None.
        spinner (str, optional): Name of spinner animation (see python -m rich.spinner). Defaults to "dots".
        spinner_style (StyleType, optional): Style of spinner. Defaults to "status.spinner".
        speed (float, optional): Speed factor for spinner animation. Defaults to 1.0.
        refresh_per_second (float, optional): Number of refreshes per second. Defaults to 12.5.
    NÚdotszstatus.spinnerg      ð?g      )@)ÚconsoleÚspinnerÚspinner_styleÚspeedÚrefresh_per_second)Ústatusr   r   r   r   r   c                C   s<   || _ || _|| _t||||d�| _t| j||dd�| _d S )N©ÚtextÚstyler   T)r   r   Ú	transient)r   r   r   r
   Ú_spinnerr	   Ú
renderableÚ_live)Úselfr   r   r   r   r   r   © r   úT/home/httpd/docs/test/DocsMgr/lib/python3.9/site-packages/pip/_vendor/rich/status.pyÚ__init__   s    
üzStatus.__init__)Úreturnc                 C   s   | j S ©N)r   ©r   r   r   r   r   ,   s    zStatus.renderabler   c                 C   s   | j jS )z+Get the Console used by the Status objects.)r   r   r!   r   r   r   r   0   s    zStatus.console)r   r   r   )r   r   r   r   r   c                C   sz   |dur|| _ |dur|| _|dur*|| _|dur^t|| j | j| jd�| _| jj| jdd� n| jj| j | j| jd� dS )aó  Update status.

        Args:
            status (Optional[RenderableType], optional): New status renderable or None for no change. Defaults to None.
            spinner (Optional[str], optional): New spinner or None for no change. Defaults to None.
            spinner_style (Optional[StyleType], optional): New spinner style or None for no change. Defaults to None.
            speed (Optional[float], optional): Speed factor for spinner animation or None for no change. Defaults to None.
        Nr   T)Úrefresh)r   r   r   r
   r   r   Úupdater   )r   r   r   r   r   r   r   r   r#   5   s    ÿÿzStatus.updatec                 C   s   | j  ¡  dS )zStart the status animation.N)r   Ústartr!   r   r   r   r$   U   s    zStatus.startc                 C   s   | j  ¡  dS )zStop the spinner animation.N)r   Ústopr!   r   r   r   r%   Y   s    zStatus.stopc                 C   s   | j S r    )r   r!   r   r   r   Ú__rich__]   s    zStatus.__rich__c                 C   s   |   ¡  | S r    )r$   r!   r   r   r   Ú	__enter__`   s    zStatus.__enter__)Úexc_typeÚexc_valÚexc_tbr   c                 C   s   |   ¡  d S r    )r%   )r   r(   r)   r*   r   r   r   Ú__exit__d   s    zStatus.__exit__)N)Ú__name__Ú
__module__Ú__qualname__Ú__doc__r   r   r   Ústrr   Úfloatr   Úpropertyr
   r   r   r#   r$   r%   r&   r'   r   ÚBaseExceptionr   r+   r   r   r   r   r      sN   øø þúù 
ûr   Ú__main__)Úsleep)r   z"[magenta]Covid detector booting upé   zImporting advanced AIzAdvanced Covid AI Readyz[bold blue] Scanning for CovidÚearth)r   r   z*Found 10,000,000,000 copies of Covid32.exez%[bold red]Moving Covid32.exe to TrashÚbouncingBallÚyellow)r   r   r   é   Nz&[bold green]Covid deleted successfully)Útypesr   Útypingr   r   r   r   r   Újupyterr   Úliver	   r   r
   r   r   r   r,   Útimer5   r   Úlogr#   Úprintr   r   r   r   Ú<module>   s8   b



ý(