
    si
                       S r SSKJr  SSKrSSKrSSKJr  SSKJr  \(       a  SSK	J
r
  SSKJr  SS	KJrJr  \(       a  SS
KJr  SSKJrJr  \R*                  " \5      r\SSS jj5       rSSS jjrSS jrSS jrSSS jjrSSS jjrg)z/
Holds functions for output rendering in conda
    )annotationsN)cache)TYPE_CHECKING)AbstractContextManager   )context)CondaSystemExit
DryRunExit)Callable)ProgressBarBaseSpinnerBasec                    [         R                  n[         R                  R                  U5      nUR	                  5       nU b!  [        X0S5      nUc  [        SU  S35      e U$ [        US5      nU$ )z&
Retrieves the render function to use
N'z'' is not a valid reporter backend stylerender)r   consoleplugin_managerget_reporter_backendrenderergetattrAttributeError)stylebackendreporterr   render_funcs        /lib/python3.13/site-packages/conda/reporters.py_get_render_funcr      s    
 ooG%%::7CH  "Hht4 1UG+R!STT 
  h1    c                j    [        U5      nU" U 40 UD6n[        R                  R                  U5        g)z
Used to render output in conda

The output will either be rendered as "json" or normal "console" output to stdout.
This function allows us to configure different reporter backends for these two types
of output.
N)r   sysstdoutwrite)datar   kwargsr   data_strs        r   r   r   0   s/     #5)K4*6*HJJXr   c                &    [        S5      " U 40 UD6$ )zI
Retrieve the progress bar for the currently configured reporter backend
progress_barr   )descriptionr#   s     r   get_progress_barr)   =   s     N+KB6BBr   c                 "    [        S5      " 5       $ )zG
Retrieve progress bar context manager to use with registered reporter
progress_bar_context_managerr'    r   r    get_progress_bar_context_managerr-   D   s     :;==r   c                $    [        S5      " X5      $ )z2
Retrieve spinner to use with registered reporter
spinnerr'   )messagefail_messages     r   get_spinnerr2   K   s     I&w==r   c                    Uc  [         R                  (       d  U(       a
  [        5       e[         R                  (       a  g [	        S5      " U SUS9nUS:X  a  [        S5      eg! [
         a    [        S5      ef = f)z'
Display a "yes/no" confirmation input
Tprompt)yesno)choicesdefaultz
Operation aborted.  Exiting.r6   zExiting.)r   dry_runr
   
always_yesr   KeyboardInterruptr	   )r0   r8   r9   choices       r   
confirm_ynr=   R   sw     	GOOl@!(+]G
 ~j))  @>??@s   A$ $A:)N)r   
str | Nonereturnr   )r   r>   r?   None)r(   strr?   r   )r?   r   )zfailed
)r0   rA   r1   rA   r?   r   )Proceedr5   N)r0   rA   r?   bool)__doc__
__future__r   loggingr   	functoolsr   typingr   
contextlibr   base.contextr   
exceptionsr	   r
   collections.abcr   plugins.typesr   r   	getLogger__name__loggerr   r   r)   r-   r2   r=   r,   r   r   <module>rQ      sn    #  
   1 ! 3(;			8	$  &
C>>r   