
    <Bh                         S r SSKJr  SSKJr  SSKJr  SSKJrJ	r	J
r
  SSKJr  SSKJr  SS	KJr  S
SKJrJr  \R(                  " SSSS9  \" \5      r " S S5      r\R0                  r\R2                  rS rg)z7Wrapper for running conda CLI commands as a Python API.    )	getLogger   )SEARCH_PATH)context)CaptureTargetargvcaptured)
deprecated)conda_exception_handler)initialize_std_loggers   )do_callgenerate_parserz24.3z25.9z&Use `conda.testing.conda_cli` instead.)addendumc                   @    \ rS rSrSrSrSrSrSrSr	Sr
S	rS
rSrSrSrg)Commands   cleanconfigcreateinfoinstalllistremovesearchupdaterunnotices N)__name__
__module____qualname____firstlineno__CLEANCONFIGCREATEINFOINSTALLLISTREMOVESEARCHUPDATERUNNOTICES__static_attributes__r       4lib/python3.13/site-packages/conda/cli/python_api.pyr   r      s9    EFFDGDFFF
CGr0   r   c                 >   [        5         UR                  SS5      nUR                  S[        5      nUR                  S[        5      nUR                  S[        5      n[	        5       nU(       a  [        US   [        5      (       a  US   n[        U5      nUR                  SU 5        UR                  U5      nSUl	        [        R                  " UUS9  SS	KJn	  [        R                  S
U	" U5      5        US   S:H  n
U
(       a  SnOXV4n [!        S/UQ5         [#        U6  nU(       a  [%        [&        X5      nO['        X5      nSSS5        SSS5        U
(       a%  WR(                  nUR*                  nUR,                  nOWR(                  nUR*                  n W=(       d    Sn[        R                  SXVU5        XVU4$ ! , (       d  f       N= f! , (       d  f       N= f! [.         a+  n[        R                  SXV5        XVsUl        Ul        UeSnAff = f)a  Runs a conda command in-process with a given set of command-line interface arguments.

Differences from the command-line interface:
    Always uses --yes flag, thus does not ask for confirmation.

Args:
    command: one of the Commands.
    *arguments: instructions you would normally pass to the conda command on the command line
                see below for examples. Be very careful to delimit arguments exactly as you
                want them to be delivered. No 'combine then split at spaces' or other
                information destroying processing gets performed on the arguments.
    **kwargs: special instructions for programmatic overrides

Keyword Args:
    use_exception_handler: defaults to False. False will let the code calling
      `run_command` handle all exceptions.  True won't raise when an exception
      has occurred, and instead give a non-zero return code
    search_path: an optional non-standard search path for configuration information
      that overrides the default SEARCH_PATH
    stdout: Define capture behavior for stream sys.stdout. Defaults to STRING.
      STRING captures as a string.  None leaves stream untouched.
      Otherwise redirect to file-like object stdout.
    stderr: Define capture behavior for stream sys.stderr. Defaults to STRING.
      STRING captures as a string.  None leaves stream untouched.
      STDOUT redirects to stdout target and returns None as stderr value.
      Otherwise redirect to file-like object stderr.

Returns:
    a tuple of stdout, stderr, and return_code.
    stdout, stderr are either strings, None or the corresponding file-like function argument.

Examples:
    >>> run_command(Commands.CREATE, "-n", "newenv", "python=3", "flask",                         use_exception_handler=True)
    >>> run_command(Commands.CREATE, "-n", "newenv", "python=3", "flask")
    >>> run_command(Commands.CREATE, ["-n", "newenv", "python=3", "flask"], search_path=())
use_exception_handlerFsearch_pathstdoutstderrr   T)r4   argparse_args)list2cmdlinezexecuting command >>>  conda %sr   )NN
python_apiNz
  stdout: %s
  stderr: %sz,
  stdout: %s
  stderr: %s
  return_code: %s)r   popr   STRINGr   
isinstancer   insert
parse_argsyesr   __init__
subprocessr8   logdebugr   r	   r   r   r5   r6   rc	Exception)command	argumentskwargsr3   configuration_search_pathr5   r6   pargsr8   is_runcap_argscresultereturn_codes                   r1   run_commandrR   '   s   L "JJ'>F &

=+ FZZ&)FZZ&)FAZ	!d33aL	YIQ <<	"DDH-
 (II/i1HIq\U"F#<,),-x/Ba$0$B )	 0C-
 ]]F]]FYYFXXFXXF
 +AKII96; ;&&) 0C/B--  		0&A#!(sN   G' 	G&$G
G3G' G' 
G	G
G$ G' '
H1&HHN)__doc__loggingr   base.constantsr   base.contextr   	common.ior   r   r	   deprecationsr
   
exceptionsr   gateways.loggingr   conda_argparser   r   moduler    rB   r   r;   STDOUTrR   r   r0   r1   <module>r^      sj    >  ( " 5 5 % 0 5 4 
  &&+S T  
					X'r0   