
    i                        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  SSKJ	r	  SSK
Jr  SS jrSS	 jrSS
 jrSS jrSSS jjr\S:X  a  \" \R$                  SS 5        gg)z
CLI for conda-token.
    )annotationsN)ArgumentParser)	Namespace)__version__)repo_configc                T   [         R                  " 5       R                  5        VVs0 s H  u  pU[         R                  :X  d  M  X_M     nnnU(       d*  [	        S[         R                   3[
        R                  S9  gUR                  5        H  u  pE[	        XE5        M     gs  snnf )z$Default function for list subparser.z#No tokens have been configured for file   r   )r   
token_listitemsREPO_URLprintsysstderr)argskvtokensurltokens         @lib/python3.13/site-packages/anaconda_auth/_conda/conda_token.pyr   r      s     %//17799Q+BVBV=V9   1+2F2F1GH	
 lln
c % s   B$B$c                    [         R                  " U R                  U R                  S9  [         R                  " U R                  U R                  U R                  U R                  U R                  U R                  U R                  U R                  S9  [        S5        g! [         R                   a"  n[        U[        R                  S9   S nAgS nAff = f)N)no_ssl_verifyr	   r   )forcez@Success! Your token was validated and Conda has been configured.r   )r   validate_tokenr   r   CondaTokenErrorr   r   r   	token_setsystemenvr
   include_archive_channelsenable_signature_verificationforce_config_condarc)r   es     r   r   r   "   s    ""4::T=O=OP
 

		%%**''	 

LM && acjj!s   )B" "C6CCc                .    [         R                  " 5         g)Nr   )r   token_remove)r   s    r   r&   r&   7   s        c           	     j   U R                  SS[        R                   S35      nUR                  5       nUR	                  SSS[        R                   S3S9  UR	                  S	SS
[
        R                  " SS5      R                  SS5       S[        R                   S3S9  UR	                  SSSS9  g)zAdd condarc path arguments.zConfig File Location Selectionz5Without one of these flags, the user config file at 'z
' is used.z--system
store_truez&Write to the system .condarc file at 'z'.actionhelpz--envz5Write to the active conda environment .condarc file (CONDA_PREFIXz<no active environment>%z%%z?). If no environment is active, write to the user config file (z).z--filestorezWrite to the given file.N)add_argument_groupr   escaped_user_rc_pathadd_mutually_exclusive_groupadd_argumentosgetenvreplace)parserconfig_file_location_grouplocations      r   condarc_path_argsr:   <   s    !'!:!:(
?@`@`?aakl" *FFHH5k6V6V5WWYZ  
 CBIIn^wDx  EA  EA  BE  GK  EL  DM MKKVKkKkJllnp	   (79STr'   c           	        [        SSSS9nUR                  SSSSS	[         3S
9  UR                  SS9nUR	                  SSS9nUR                  [        S9  UR	                  SSS9n[        U5        UR                  [        S9  UR	                  SSS9nUR                  SSS9  UR                  S[        R                  SSS SS9  UR                  SSSS9  UR                  SSS S!9  UR                  S"SS#S!9  [        U5        UR                  [        S9  [        [        R                  5      S$:X  a  [        R                  R                  S%5        UR!                  U 5      nUR#                  U5      $ )&Nzconda-tokenzconda tokenz6Configure token access for Anaconda Commercial Edition)usagedescriptionz-Vz	--versionversionz-Show the conda-token version number and exit.zconda-token )r+   r,   r>   zToken commands)r,   listzList token if configured.)funcremovez)Remove token and revert default_channels.setz.Set your token and configure default_channels.r   zYour token.z--include-archive-channelszcAdd archived channels to default_channels. 
Available channels are mro, mro-archive, free, and pro.+CHANNEL_NAME)choicesr,   nargsdefaultmetavarz--no-ssl-verifyzForce disabling SSL verification. By default conda-token will respect your ssl_verify flag in your Conda settings. Using this flag will add ssl_verify: false to your .condarc file. If not already set.r)   )r,   r+   z--enable-signature-verificationz<Enable Conda package signature verification. Default is off.r*   z--force-config-condarczForce configuration of .condarcr   z--help)r   r3   r   add_subparsers
add_parserset_defaultsr   r:   r&   r   ARCHIVE_CHANNELSr   lenr   argvappend
parse_argsr@   )rN   r7   	subparsersubparser_listsubparser_removesubparser_setr   s          r   clirU   S   s   LF <{m,   %%+;%<I))&7R)SNZ0 ++B ,  &'!!|!4((D ) M w];$,,D   5
    )K  
  .  
 m$I.
388}!T"D99T?r'   __main__r   )r   r   returnint)r7   r   rW   None)N)rN   zlist[str] | NonerW   rX   )__doc__
__future__r   r4   r   argparser   r   anaconda_authr   anaconda_auth._condar   r   r   r&   r:   rU   __name__rN    r'   r   <module>ra      s^    # 	 
 #  % ,$*
U.AH z r'   