
    h                       S r SSKJr  SSKJr  SSKJr  SSKJr  \(       a  SSK	r	SSK
Jr  SSKJr  SS	KJr   " S
 S\5      r " S S\5      r " S S\5      r " S S\\5      r " S S\5      r " S S\5      rSS jrSS.SS jjrSS jrg)zCustom exceptions.    )annotations)TYPE_CHECKING)
CondaError)ChannelN)Iterable)Path)Selfc                      \ rS rSrSrSrg)CondaToSError   zBase exception. N)__name__
__module____qualname____firstlineno____doc____static_attributes__r       =lib/python3.13/site-packages/conda_anaconda_tos/exceptions.pyr   r      s    r   r   c                  0   ^  \ rS rSrSrSU 4S jjrSrU =r$ )CondaToSMissingError   z;Error class for when the metadata is missing for a channel.c                >   > [         TU ]  S[        U5       S35        g)+Format error message with channel base URL.zNo Terms of Service for .Nsuper__init___urlselfchannel	__class__s     r   r   CondaToSMissingError.__init__   s    3DM?!DEr   r   r!   r	   r"   str | ChannelreturnNoner   r   r   r   r   r   r   __classcell__r#   s   @r   r   r      s    EF Fr   r   c                  0   ^  \ rS rSrSrSU 4S jjrSrU =r$ )CondaToSInvalidError   z;Error class for when the metadata is invalid for a channel.c                >   > [         TU ]  S[        U5       S35        g)r   zInvalid Terms of Service for r   Nr   r    s     r   r   CondaToSInvalidError.__init__"   s    8gqIJr   r   r%   r)   r+   s   @r   r-   r-      s    EK Kr   r-   c                  D   ^  \ rS rSrSr S       SU 4S jjjrSrU =r$ )CondaToSPermissionError'   z9Error class for when the metadata file cannot be written.c                `   > U(       a  S[        U5       3OSn[        TU ]	  SU SU S35        g)z4Format error message with channel base URL and path.z for  zUnable to read/write path ()z. Please check permissions.N)r   r   r   )r!   pathr"   addendumr#   s       r   r    CondaToSPermissionError.__init__*   s9     /6U4=/*2)$q
:UV	
r   r   N)r!   r	   r7   zstr | os.PathLike[str] | Pathr"   zstr | Channel | Noner'   r(   r)   r+   s   @r   r2   r2   '   s9    C
 )-	
	
+	
 &	
 
		
 	
r   r2   c                  0   ^  \ rS rSrSrSU 4S jjrSrU =r$ )CondaToSRejectedError6   zEError class for when the Terms of Service are rejected for a channel.c           
        > U Vs/ s H  n[        U5      PM     nnU Vs/ s H  nSU 3PM
     nn[        TU ]	  S[        U5       S[        USS9 S[	        5        35        gs  snf s  snf )r   /conda tos accept --override-channels --channel zoTerms of Service has been rejected for the following channels. Please remove or accept them before proceeding:
J

To accept these channels' Terms of Service, run the following commands:
    prefix

Nr   r   r   _bullet_get_removal_guidancer!   channelsr"   channel_urlsurlaccept_commandsr#   s         r   r   CondaToSRejectedError.__init__9       5=>X'WX> $
# >cUC# 	 

 	@|$% &X v67 8$&')		
 ?

   A$A)r   r!   r	   rI   r&   r'   r(   r)   r+   s   @r   r<   r<   6   s    O
 
r   r<   c                  0   ^  \ rS rSrSrSU 4S jjrSrU =r$ )CondaToSNonInteractiveErrorM   zMError class when Terms of Service are not actionable in non-interactive mode.c           
        > U Vs/ s H  n[        U5      PM     nnU Vs/ s H  nSU 3PM
     nn[        TU ]	  S[        U5       S[        USS9 S[	        5        35        gs  snf s  snf )r   r?   ztTerms of Service have not been accepted for the following channels. Please accept or remove them before proceeding:
r@   rA   rB   rD   NrE   rH   s         r   r   $CondaToSNonInteractiveError.__init__P   rN   rO   r   rP   r)   r+   s   @r   rR   rR   M   s    W
 
r   rR   c                    [        U [        5      (       a  U O[        [        U 5      5      n[        UR                  =(       d    U 5      $ r:   )
isinstancer   strbase_url)r"   _channels     r   r   r   d   s4    $Wg66wGCL<QHx  +G,,r   z    - rB   c               0    USU 3R                  U 5      -   $ )N
)join)argsrC   s     r   rF   rF   i   s    bM&&t,,,r   c                      g)z1Generate removal guidance based on channel types.zFor information on safely removing channels from your conda configuration,
please see the official documentation:

    https://www.anaconda.com/docs/tools/working-with-conda/channelsr   r   r   r   rG   rG   m   s    	Nr   )r"   r&   r'   rX   )r^   zIterable[str]rC   rX   r'   rX   )r'   rX   )r   
__future__r   typingr   conda.exceptionsr   conda.models.channelr   oscollections.abcr   pathlibr   r	   r   r   r-   PermissionErrorr2   r<   rR   r   rF   rG   r   r   r   <module>rh      s     "   ' ((J F= FK/ K
o} 

M 
.
- 
.-
 3; -r   