o 7]hI@s:ddlmZddlmZmZddlmZmZddlm Z ddl m Z ddl m Z ddlmZGd d d e Zed krdd lmZdd lmZeZed>ZedededededejdddedededejddddedWdn1swYeddSdS)) TracebackType)OptionalType)ConsoleRenderableType) JupyterMixin)Live)Spinner) StyleTypec @seZdZdZddddddded eed ed ed e d e f ddZ e de fddZ e d&ddZ d'dddddeed eed eed ee ddf ddZd(ddZd(ddZdefddZd)dd Zd!eeed"eed#eeddfd$d%ZdS)*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_secondstatusrrrrrcCs<||_||_||_t||||d|_t|j||dd|_dS)NtextstylerT)rr transient)rrrr _spinnerr renderable_live)selfrrrrrrr9/usr/lib/python3/dist-packages/pip/_vendor/rich/status.py__init__s  zStatus.__init__returncC|jSN)rrrrrr,szStatus.renderablercCs|jjS)z+Get the Console used by the Status objects.)rrr"rrrr0szStatus.console)rrrcCs||dur||_|dur||_|dur||_|dur0t||j|j|jd|_|jj|jdddS|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.updatecC|jdS)zStart the status animation.N)rstartr"rrrr&Uz Status.startcCr%)zStop the spinner animation.N)rstopr"rrrr(Yr'z Status.stopcCr r!)rr"rrr__rich__]szStatus.__rich__cCs ||Sr!)r&r"rrr __enter__`szStatus.__enter__exc_typeexc_valexc_tbcCs |dSr!)r()rr+r,r-rrr__exit__ds zStatus.__exit__)rrr!)rN)rr )__name__ __module__ __qualname____doc__rrrstrr floatrpropertyr rrr$r&r(r)r*r BaseExceptionrr.rrrrr sj     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)rrrNz&[bold green]Covid deleted successfully)typesrtypingrrrrrjupyterrliver rr rr r r/timer8rlogr$printrrrrs>     b