U cfH @s$ddlmZddlmZmZddlmZmZddlm Z ddl m Z ddl m Z ddlmZGd d d e Zed kr dd lmZdd lmZeZedrZedededededejdddedededejddddedW5QRXeddS)) TracebackType)OptionalType)ConsoleRenderableType) JupyterMixin)Live)Spinner) StyleTypec@seZdZdZddddddeeeeee e dd d Z e e d d d Z e dd ddZd ddddeeeeeeee ddddZdd ddZdd ddZed ddZdd ddZeeeeeeeddddZdS)!StatusaDisplays 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. Ndotszstatus.spinnerg?g)@)consolespinner spinner_stylespeedrefresh_per_second)statusrrrrrcCs<||_||_||_t||||d|_t|j||dd|_dS)NtextstylerT)rr transient)rrrr _spinnerr renderable_live)selfrrrrrrrE/opt/hc_python/lib/python3.8/site-packages/pip/_vendor/rich/status.py__init__s zStatus.__init__)returncCs|jSN)rrrrrr,szStatus.renderablercCs|jjS)z+Get the Console used by the Status objects.)rrr!rrrr0szStatus.console)rrr)rrrrrcCsz|dk r||_|dk r||_|dk r*||_|dk r^t||j|j|jd|_|jj|jddn|jj|j|j|jddS)aUpdate 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. NrT)refresh)rrrr rrupdater)rrrrrrrrr#5s&z Status.updatecCs|jdS)zStart the status animation.N)rstartr!rrrr$Usz Status.startcCs|jdS)zStop the spinner animation.N)rstopr!rrrr%Ysz Status.stopcCs|jSr )rr!rrr__rich__]szStatus.__rich__cCs ||Sr )r$r!rrr __enter__`szStatus.__enter__)exc_typeexc_valexc_tbrcCs |dSr )r%)rr(r)r*rrr__exit__dszStatus.__exit__)N)__name__ __module__ __qualname____doc__rrrstrr floatrpropertyr rrr#r$r%r&r'r BaseExceptionrr+rrrrr sN   r __main__)sleep)rz"[magenta]Covid detector booting upzImporting advanced AIzAdvanced Covid AI Readyz[bold blue] Scanning for Covidearth)rrz*Found 10,000,000,000 copies of Covid32.exez%[bold red]Moving Covid32.exe to Trash bouncingBallyellow)rrrz&[bold green]Covid deleted successfullyN)typesrtypingrrrrrjupyterrliver rr rr r r,timer5rlogr#printrrrrs8     b