ó
>ò†[c           @  ss   d  Z  d d l m Z m Z d d l m Z m Z d d l Z d d l m	 Z	 e j
 d ƒ Z d „  Z d „  Z d S(	   u+   
Copy packages from one account to another
iÿÿÿÿ(   t   unicode_literalst   print_function(   t   get_server_apit   parse_specsN(   t   errorsu   binstar.copyc   	      C  s)  t  |  j |  j ƒ } |  j } | j | j ƒ } |  j rH |  j rH d n d } |  j } |  j } | | k rœ t j	 d j
 | j ƒ  | d j | ƒ ƒ ƒ ‚ n  | j | j | j | j | j d |  j d | d | ƒ} x | D] } t d | ƒ qÜ W| rt j d	 t | ƒ ƒ n t j d
 | ƒ d  S(   Nu   labelu   channelu,   {} {} does not exist
	please choose from: {}u   , t   to_ownert
   from_labelt   to_labelu   Copied file: %(basename)su   Copied %i filesuH   Did not copy any files. Please check your inputs with

	anaconda show %s(   R   t   tokent   sitet   spect   list_channelst   userR   R   R   t	   UserErrort   formatt   titlet   joint   copyt   packaget   versiont	   _basenameR   t   printt   loggert   infot   lent   warning(	   t   argst   aserver_apiR
   t   channelst
   label_textR   R   t   filest   binstar_file(    (    s[   lib/python2.7/site-packages/anaconda_client-1.7.2-py2.7.egg/binstar_client/commands/copy.pyt   main   s(    				c         C  s¥   |  j  d d d d t ƒ} | j d d d d t ƒ| j d d d	 ƒ| j ƒ  } | j ƒ  } | j d
 d d d d ƒ| j d d d d d ƒ| j d t ƒ d  S(   Nu   copyt   helpu)   Copy packages from one account to anothert   descriptionu   specul   Package - written as user/package/version[/filename] If filename is not given, copy all files in the versiont   typeu
   --to-owneru7   User account to copy package to (default: your account)u   --from-labelu   Label to copy packages fromt   defaultu   mainu
   --to-labelu   Label to put all packages intoR    (   t
   add_parsert   __doc__t   add_argumentR   t   add_mutually_exclusive_groupt   set_defaultsR    (   t
   subparserst   parsert   _fromt   _to(    (    s[   lib/python2.7/site-packages/anaconda_client-1.7.2-py2.7.egg/binstar_client/commands/copy.pyR%   ,   s    	(   R&   t
   __future__R    R   t   binstar_client.utilsR   R   t   loggingt   binstar_clientR   t	   getLoggerR   R    R%   (    (    (    s[   lib/python2.7/site-packages/anaconda_client-1.7.2-py2.7.egg/binstar_client/commands/copy.pyt   <module>   s   	 