
    wBf                         d Z ddlZddlmZ  ej                  dddd	      d
        Z eddd	      d        ZdddZd Zd Z	y)z&Entry point for all conda subcommands.    N   )
deprecatedz24.3z24.9contextz9The context is a global state, no need to pass it around.)addendumc                      dd l } ddlm} ddlm}m}  |        |j                  r4dD ]/  }| j                  |      j                  | j                  dz          1  ||j                         y )Nr   r   r   )initialize_loggingset_log_level)zconda.stdout.verbosezconda.stdoutlogzconda.stderrlog
   )loggingbase.contextr   gateways.loggingr	   r
   json	getLoggersetLevelCRITICAL	log_level)r   r   r	   r
   loggers        .lib/python3.12/site-packages/conda/cli/main.pyinit_loggersr   
   sa     &D ||T 	FFf%..w/?/?"/DE	F '##$    z7Use `conda.cli.conda_argparse.generate_parser` instead.c                      ddl m}  || i |S )z
    Some code paths import this function directly from this module instead
    of from conda_argparse. We add the forwarder for backwards compatibility.
       )generate_parser)conda_argparser   )argskwargsr   s      r   r   r   !   s     0D+F++r   )post_parse_hookc                 L   ddl m} ddlm}m}m} |xs dg} |d      }|j                  |      \  }}	|j                  |j                  |j                  |j                  d}
|j                  |	       |j                  r|j                  j                          |j                  |	        |d
      }|j                  ||
|      }|j                  |	       t!                | r	 | ||        |||      }t#        |t$              r|S t'        |d      r|j(                  S y)zOEntrypoint for the "subshell" invocation of CLI interface. E.g. `conda create`.r   r   r   )do_callr   generate_pre_parserz--helpF)add_help)r   debugtrace	verbosity)argparse_argsT)override_args	namespacercN)r   r   r   r    r   r!   parse_known_argsr   r#   r$   r%   __init__
no_pluginsplugin_managerdisable_external_plugins
parse_argsr   
isinstanceinthasattrr)   )r   r   r   r   r    r   r!   
pre_parserpre_args_r'   parser	exit_codes                r   main_subshellr8   0   s    'MMH:D$e4J--d3KHa ''	M 8,779 8,d+FT(SD4(N f%f%I)S!	D	!|| 
"r   c                     | j                  ddd      } ddlm} |j                          ddlm} 	  ||       } ||      }t        |j                         d	       y
# t        $ r ddlm}  |d| z        w xY w)zPEntrypoint for the "sourced" invocation of CLI interface. E.g. `conda activate`.shell. r   r   r   )_build_activator_cls)
CondaErrorz%s is not a supported shell.)endr   )replacer   r   r+   activater<   KeyError
exceptionsr=   printexecute)shellr   r   r   r<   activator_clsr=   	activators           r   main_sourcedrH   [   s    MM(B*E '/A,U3 d#I	)


2&  A+7%?@@As   A A8c                      ddl m ddlm} | xs t        j
                  dd  } t        fd| D              } | r)| d   j                         j                  d      rt        }nt        } ||g| i |S )Nr   )ensure_text_type)conda_exception_handlerr   c              3   .   K   | ]  } |        y w)N ).0srJ   s     r   	<genexpr>zmain.<locals>.<genexpr>y   s     3!!$3s   r   r:   )common.compatrJ   exception_handlerrK   sysargvtuplestrip
startswithrH   r8   )r   r   rK   mainrJ   s       @r   rX   rX   r   sh    0; 388AB<D3d33DQ**84"49$9&99r   )
__doc__rS   deprecationsr   argumentr   r   r8   rH   rX   rM   r   r   <module>r\      st    - 
 % 

H	%%" 

F
,
, *. (V.:r   