
@K7]c           @   s   d  d l  m Z d  d l Z d  d l m Z m Z d  d l Z d  d l m Z d  d l	 m
 Z
 d  d l m Z e j d e j  d Z d	   Z d
   Z d   Z d S(   i(   t   getpreferredencodingN(   t   abspatht
   expanduser(   t   ArgumentParser(   t   api(   t   PY3t   levels  

Tool to convert packages

conda convert converts pure Python packages to other platforms.

Packages are automatically organized in subdirectories according to platform,
e.g.,

osx-64/
  package-1.0-py33.tar.bz2
win-32/
  package-1.0-py33.tar.bz2

Examples:

Convert a package built with conda build to Windows 64-bit, and place the
resulting package in the current directory (supposing a default Anaconda
install on Mac OS X):

    conda convert package-1.0-py33.tar.bz2 -p win-64

c         C   s]  t  d d d t  } | j d d d d d | j d	 d
 d d d d d d d d d d d d d d d g
 d d d d  | j d d d d d d | j d  d d! d t d d" | j d# d$ d d! d d% | j d& d' d d( d d) | j d* d+ d t d d! d d, | j d- d d! d d. | j d/ d0 d d! d d1 | j |   }  | |  f S(2   Nt   descriptions   
Various tools to convert conda packages. Takes a pure Python package build for
one platform and converts it to work on one or more other platforms, or
all.t   epilogt   filest   nargst   +t   helps   Package files to convert.s   -ps
   --platformt   destt	   platformst   actiont   appendt   choicess   osx-64s   linux-32s   linux-64s   linux-ppc64les   linux-armv6ls   linux-armv7ls   linux-aarch64s   win-32s   win-64t   alls$   Platform to convert the packages to.t   defaults   --dependenciess   -dt   *s   Additional (besides python) dependencies of the converted
        package.  To specify a version restriction for a dependency, wrap
        the dependency in quotes, like 'package >=2.0'.s   --show-importst
   store_trues6   Show Python imports for compiled parts of the package.s   -fs   --forces=   Force convert, even when a package has compiled C extensions.s   -os   --output-dirt   .s   Directory to write the output files. The packages will be
        organized in platform/ subdirectories, e.g.,
        win-32/package-1.0-py27_0.tar.bz2.s   -vs	   --verboses   Print verbose output.s	   --dry-runs'   Only display what would have been done.s   -qs   --quiets   Don't print as much output.(   R   R   t   add_argumentt   Nonet   Falset
   parse_args(   t   argst   p(    (    s;   lib/python2.7/site-packages/conda_build/cli/main_convert.pyR   ,   s`    								c         C   sz   t  |   \ } }  |  j } |  j d =xN | D]F } t sM | j t    } n  t t |   } t j	 | |  j  q, Wd  S(   NR	   (
   R   R	   t   __dict__R   t   decodeR    R   R   R   t   convert(   R   t   _R	   t   f(    (    s;   lib/python2.7/site-packages/conda_build/cli/main_convert.pyt   executes   s    	
c           C   s   t  t j d  S(   Ni   (   R"   t   syst   argv(    (    (    s;   lib/python2.7/site-packages/conda_build/cli/main_convert.pyt   main   s    (   t   localeR    t   loggingt   os.pathR   R   R#   t   conda_build.conda_interfaceR   t   conda_buildR   t   conda_build.utilsR   t   basicConfigt   INFOR   R   R"   R%   (    (    (    s;   lib/python2.7/site-packages/conda_build/cli/main_convert.pyt   <module>   s   	G	