ó
.żWc           @   s9   d  d l  Z  d  d l m Z d e j f d     YZ d S(   i˙˙˙˙N(   t   uploadR    c           B   s)   e  Z d  Z d   Z d   Z d   Z RS(   sa   
    Override default upload behavior to obtain password
    in a variety of different ways.
    c         C   s8   t  j j |   |  j p. |  j   p. |  j   |  _ d  S(   N(   t   origR    t   finalize_optionst   passwordt   _load_password_from_keyringt   _prompt_for_password(   t   self(    (    s=   /tmp/pip-build-Q3rTTP/setuptools/setuptools/command/upload.pyR      s    	c         C   s>   y& t  d  } | j |  j |  j  SWn t k
 r9 n Xd S(   sM   
        Attempt to load password from keyring. Suppress Exceptions.
        t   keyringN(   t
   __import__t   get_passwordt
   repositoryt   usernamet	   Exception(   R   R   (    (    s=   /tmp/pip-build-Q3rTTP/setuptools/setuptools/command/upload.pyR      s
    c         C   s,   y t  j    SWn t t f k
 r' n Xd S(   sH   
        Prompt for a password on the tty. Suppress Exceptions.
        N(   t   getpassR   t   KeyboardInterrupt(   R   (    (    s=   /tmp/pip-build-Q3rTTP/setuptools/setuptools/command/upload.pyR      s    (   t   __name__t
   __module__t   __doc__R   R   R   (    (    (    s=   /tmp/pip-build-Q3rTTP/setuptools/setuptools/command/upload.pyR       s   	
	
(   R   t   distutils.commandR    R   (    (    (    s=   /tmp/pip-build-Q3rTTP/setuptools/setuptools/command/upload.pyt   <module>   s   