ó
Ż²k^c           @@ s¬   d  d l  m Z m Z d  d l m Z d  d l Z d  d l Z d  d l m Z m	 Z	 d d l
 m Z m Z d d l m Z d d	 l m Z d
 Z d Z d   Z d   Z d S(   i    (   t   absolute_importt   print_function(   t   RawDescriptionHelpFormatterN(   t   add_parser_jsont   add_parser_prefixi   (   t
   get_prefixt   stdout_jsoni   (   t   from_environment(   t   CondaEnvExceptions   
Export a given environment
sF   
examples:
    conda env export
    conda env export --file SOME_FILE
c      
   C@ s  |  j  d d t d t d t d t } | j d d d d	 d d
 | j d d d d d t |  | j d d d d  d t | j d d t d d d t d d | j d d t d d d t d d t |  | j d d t d d d t d d | j	 d d  d  S(   Nt   exportt   formatter_classt   descriptiont   helpt   epilogs   -cs	   --channelt   actiont   appends+   Additional channel to include in the exports   --override-channelst
   store_trues    Do not include .condarc channelss   -fs   --filet   defaultt   requireds   --no-buildss,   Remove build specification from dependenciess   --ignore-channelss0   Do not include channel names with package names.s   --from-historys5   Build environment spec from explicit specs in historyt   funcs   .main_export.execute(
   t
   add_parserR   R   t   examplet   add_argumentR   t   Nonet   FalseR   t   set_defaults(   t   sub_parserst   p(    (    s8   lib/python2.7/site-packages/conda_env/cli/main_export.pyt   configure_parser   sN    		
	
c      	   C@ sw  |  j  p |  j s t j j d t  } | s[ d } | t j d  j   7} t	 |   n  t j
 | k rv | |  _ q | |  _  n	 |  j  } t |   } t | | d |  j d |  j d |  j } |  j r× | j   n  |  j d  k	 rł | j |  j  n  |  j d  k r6|  j r#t | j    n t | j    n= t |  j d  } |  j rc| j d |  n | j d |  d  S(	   Nt   CONDA_DEFAULT_ENVs!   Unable to determine environment

sŪ   
                Please re-run this command with one of the following options:

                * Provide an environment name via --name or -n
                * Re-run this command inside an activated conda environment.t	   no_buildst   ignore_channelst   from_historyt   wbt   stream(   t   namet   prefixt   ost   environt   getR   t   textwrapt   dedentt   lstripR   t   sepR   R   R   R   R    t   override_channelst   remove_channelst   channelR   t   add_channelst   filet   jsonR   t   to_dictt   printt   to_yamlt   open(   t   argst   parserR#   t   msgR$   t   envt   fp(    (    s8   lib/python2.7/site-packages/conda_env/cli/main_export.pyt   executeS   s,    			.(   t
   __future__R    R   t   argparseR   R%   R(   t   conda.cli.conda_argparseR   R   t   commonR   R   R9   R   t
   exceptionsR   R   R   R   R;   (    (    (    s8   lib/python2.7/site-packages/conda_env/cli/main_export.pyt   <module>   s   	7