
    ce                     x    d Z ddlmZmZ ddlZ	 ddlmZ n# e$ r	 ddlmZ Y nw xY wddl	m
Z
 ddlmZ d Zd ZdS )	zeThe ``activate`` command which prepares a project to run and prints commands to source in your shell.    )absolute_importprint_functionN)quote)$prepare_with_ui_mode_printing_errors)load_projectc           	         t          |           }t          ||||          }|j        rdS g }t          |j                                                  }|                                 |D ]j}|j        |         }	|t          j        vst          j        |         |	k    r7|                    d	                    |t          |	                               k|S )zPrepare project and return lines to be sourced.

    Future direction: should also activate the proper conda env.

    Returns:
        None on failure or a list of lines to print.
    )ui_modeenv_spec_namecommand_nameNzexport {key}={value})keyvalue)r   r   failedlistenvironkeyssortosappendformatr   )
dirnamer	   conda_environmentr   projectresultexportssorted_keysr   r   s
             Flib/python3.11/site-packages/anaconda_project/internal/cli/activate.pyactivater      s     7##G1':A@Q?KM M MF } tGv~**,,--K W Ws#bj  	WBJsOu$< 	WNN188Se8UUVVVN    c                     t          | j        | j        | j        | j                  }|dS |D ]}t          |           dS )z7Start the activate command and return exit status code.N   r   )r   	directorymodeenv_speccommandprint)argsr   lines      r   mainr(   1   sK    dndiMMF q 	 	D$KKKKqr   )__doc__
__future__r   r   r   shlexr   ImportErrorpipes/anaconda_project.internal.cli.prepare_with_moder   *anaconda_project.internal.cli.project_loadr   r   r(    r   r   <module>r1      s    l k 6 6 6 6 6 6 6 6 				    a ` ` ` ` ` C C C C C C  6    s    %%