ó
äL]c           @   sö   d  Z  d d l m Z d e f d     YZ d e f d     YZ d e f d     YZ d	 e f d
     YZ d e f d     YZ d e f d     YZ	 d e f d     YZ
 d e f d     YZ d e f d     YZ d e f d     YZ d S(   s   Exceptions module for rfc3986.i   (   t   compatt   RFC3986Exceptionc           B   s   e  Z d  Z RS(   s-   Base class for all rfc3986 exception classes.(   t   __name__t
   __module__t   __doc__(    (    (    sL   /tmp/pip-build-sZz8gW/pip/pip/_vendor/urllib3/packages/rfc3986/exceptions.pyR      s   t   InvalidAuthorityc           B   s   e  Z d  Z d   Z RS(   s/   Exception when the authority string is invalid.c         C   s,   t  t |   j d j t j |    d S(   s4   Initialize the exception with the invalid authority.u!   The authority ({0}) is not valid.N(   t   superR   t   __init__t   formatR    t   to_str(   t   selft	   authority(    (    sL   /tmp/pip-build-sZz8gW/pip/pip/_vendor/urllib3/packages/rfc3986/exceptions.pyR      s    (   R   R   R   R   (    (    (    sL   /tmp/pip-build-sZz8gW/pip/pip/_vendor/urllib3/packages/rfc3986/exceptions.pyR      s   t   InvalidPortc           B   s   e  Z d  Z d   Z RS(   s#   Exception when the port is invalid.c         C   s#   t  t |   j d j |   d S(   s/   Initialize the exception with the invalid port.s   The port ("{0}") is not valid.N(   R   R   R   R   (   R
   t   port(    (    sL   /tmp/pip-build-sZz8gW/pip/pip/_vendor/urllib3/packages/rfc3986/exceptions.pyR      s    (   R   R   R   R   (    (    (    sL   /tmp/pip-build-sZz8gW/pip/pip/_vendor/urllib3/packages/rfc3986/exceptions.pyR      s   t   ResolutionErrorc           B   s   e  Z d  Z d   Z RS(   s1   Exception to indicate a failure to resolve a URI.c         C   s)   t  t |   j d j | j     d S(   s)   Initialize the error with the failed URI.s   {0} is not an absolute URI.N(   R   R   R   R   t   unsplit(   R
   t   uri(    (    sL   /tmp/pip-build-sZz8gW/pip/pip/_vendor/urllib3/packages/rfc3986/exceptions.pyR   #   s    (   R   R   R   R   (    (    (    sL   /tmp/pip-build-sZz8gW/pip/pip/_vendor/urllib3/packages/rfc3986/exceptions.pyR       s   t   ValidationErrorc           B   s   e  Z d  Z RS(   s,   Exception raised during Validation of a URI.(   R   R   R   (    (    (    sL   /tmp/pip-build-sZz8gW/pip/pip/_vendor/urllib3/packages/rfc3986/exceptions.pyR   )   s   t   MissingComponentErrorc           B   s   e  Z d  Z d   Z RS(   s6   Exception raised when a required component is missing.c         G   sz   d } t  |  d k r! d } n  | |  _ t |  |  _ d j |  j  } t t |   j d j | |  | |  j  d S(   s5   Initialize the error with the missing component name.t   wasi   t   weres   , s   {} {} required but missingN(	   t   lenR   t   sortedt
   componentst   joinR   R   R   R   (   R
   R   t   component_namest   verbR   (    (    sL   /tmp/pip-build-sZz8gW/pip/pip/_vendor/urllib3/packages/rfc3986/exceptions.pyR   2   s    		(   R   R   R   R   (    (    (    sL   /tmp/pip-build-sZz8gW/pip/pip/_vendor/urllib3/packages/rfc3986/exceptions.pyR   /   s   t   UnpermittedComponentErrorc           B   s   e  Z d  Z d   Z RS(   s;   Exception raised when a component has an unpermitted value.c         C   sY   t  t |   j d j | t t |   |  | | |  | |  _ | |  _ | |  _ d S(   s4   Initialize the error with the unpermitted component.s.   {} was required to be one of {!r} but was {!r}N(	   R   R   R   R   t   listR   t   component_namet   component_valuet   allowed_values(   R
   R   R   R   (    (    sL   /tmp/pip-build-sZz8gW/pip/pip/_vendor/urllib3/packages/rfc3986/exceptions.pyR   E   s    		(   R   R   R   R   (    (    (    sL   /tmp/pip-build-sZz8gW/pip/pip/_vendor/urllib3/packages/rfc3986/exceptions.pyR   B   s   t   PasswordForbiddenc           B   s   e  Z d  Z d   Z RS(   sC   Exception raised when a URL has a password in the userinfo section.c            sJ   t    d   f d    } t t |   j d j |       |  _ d S(   s9   Initialize the error with the URI that failed validation.R   c              s     S(   N(    (    (   R   (    sL   /tmp/pip-build-sZz8gW/pip/pip/_vendor/urllib3/packages/rfc3986/exceptions.pyt   <lambda>Y   s    s4   "{}" contained a password when validation forbade itN(   t   getattrR   R    R   R   R   (   R
   R   R   (    (   R   sL   /tmp/pip-build-sZz8gW/pip/pip/_vendor/urllib3/packages/rfc3986/exceptions.pyR   W   s
    (   R   R   R   R   (    (    (    sL   /tmp/pip-build-sZz8gW/pip/pip/_vendor/urllib3/packages/rfc3986/exceptions.pyR    T   s   t   InvalidComponentsErrorc           B   s   e  Z d  Z d   Z RS(   s9   Exception raised when one or more components are invalid.c         G   sz   d } t  |  d k r! d } n  | |  _ t |  |  _ d j |  j  } t t |   j d j | |  | |  j  d S(   s8   Initialize the error with the invalid component name(s).R   i   R   s   , s   {} {} found to be invalidN(	   R   R   R   R   R   R   R#   R   R   (   R
   R   R   R   R   (    (    sL   /tmp/pip-build-sZz8gW/pip/pip/_vendor/urllib3/packages/rfc3986/exceptions.pyR   e   s    		(   R   R   R   R   (    (    (    sL   /tmp/pip-build-sZz8gW/pip/pip/_vendor/urllib3/packages/rfc3986/exceptions.pyR#   b   s   t   MissingDependencyErrorc           B   s   e  Z d  Z RS(   sB   Exception raised when an IRI is encoded without the 'idna' module.(   R   R   R   (    (    (    sL   /tmp/pip-build-sZz8gW/pip/pip/_vendor/urllib3/packages/rfc3986/exceptions.pyR$   u   s   N(   R   t    R    t	   ExceptionR   R   R   R   R   R   R   R    R#   R$   (    (    (    sL   /tmp/pip-build-sZz8gW/pip/pip/_vendor/urllib3/packages/rfc3986/exceptions.pyt   <module>   s   
		