B
    T[	                 @   sV   d Z ddlmZmZmZ ddlmZ ddlmZ ddl	Z	e	
dZdd Zd	d
 ZdS )zn
Remove an object from your Anaconda repository.

example::

    anaconda remove sean/meta/1.2.0/meta.tar.gz

    )get_server_apiparse_specs
bool_input)RawTextHelpFormatter)errorsNzbinstar.removec          	   C   s>  t | j| j}x(| jD ]}y|jrjd|f }| js@t|drZ||j|j	|j
|j qtd|  n|jrd|f }| jst|dr||j|j	|j
 qtd|  nN|jrd|f }| jst|dr||j|j	 qtd|  ntd| W q tjk
r4   | jr.tjdd	d
 wn Y qX qW d S )Nz)Are you sure you want to remove file %s ?FzNot removing file %szRAre you sure you want to remove the package release %s ? (and all files under it?)zNot removing release %szHAre you sure you want to remove the package %s ? (and all data with it?)z!Invalid package specification: %s T)exc_info)r   tokenZsitespecsZ	_basenameZforcer   Zremove_distuserpackageversionbasenameloggerZwarningZ_versionZremove_releaseZ_packageZremove_packageerrorr   ZNotFound)argsZaserver_apispecmsg r   ]lib/python3.7/site-packages/anaconda_client-1.7.2-py3.7.egg/binstar_client/commands/remove.pymain   s0    


r   c             C   sF   | j ddttd}|jddtdd |jdd	d
dd |jtd d S )NremovezRemove an object from your Anaconda repository. Must refer to the formal package name as it appears in the URL of the package. Also use anaconda show <USERNAME> to see list of package names. Example: anaconda remove continuumio/empty-example-notebook)helpZdescriptionZformatter_classr
   z>Package written as <user>[/<package>[/<version>[/<filename>]]]+)r   typenargsz-fz--forcezDo not prompt removal
store_true)r   action)r   )
add_parser__doc__r   add_argumentr   Zset_defaultsr   )Z
subparsersparserr   r   r   r   5   s    
r   )r   Zbinstar_client.utilsr   r   r   argparser   Zbinstar_clientr   ZloggingZ	getLoggerr   r   r   r   r   r   r   <module>   s   
#