ó
nÈ}Mc        %   @   s  d  Z  d d l Z d d l m 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 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 y` d d l Z i e e j 6e e j 6e e j 6Z  e! e d- ƒ rIe e  e j" <e e  e j# <n  Wn e$ k
 rci  Z  n Xd. „  Z% d/ e f d0 „  ƒ  YZ& d1 e& f d2 „  ƒ  YZ' d3 e& f d4 „  ƒ  YZ( d5 e' f d6 „  ƒ  YZ) d7 e* f d8 „  ƒ  YZ+ d9 e* f d: „  ƒ  YZ, d; e- f d< „  ƒ  YZ. e j/ e d= d> d? d? ƒ d@ e0 d; ƒ dA e( f dB „  ƒ  YZ1 dC e' f dD „  ƒ  YZ2 dE e f dF „  ƒ  YZ3 dG e4 f dH „  ƒ  YZ5 dI e4 f dJ „  ƒ  YZ6 dK e4 f dL „  ƒ  YZ7 dM e4 f dN „  ƒ  YZ8 dO e4 f dP „  ƒ  YZ9 dQ e: f dR „  ƒ  YZ; dS e f dT „  ƒ  YZ< d d d	 d d d d d d d d d d d d! d# d% d' d) d+ dU d/ d1 d3 d5 d7 d9 d; dA dC dE dG dI dK dO dQ dS g% Z= d S(V   s`   
Exceptions and errors for use in twisted.internet modules.

Maintainer: Itamar Shtull-Trauring
iÿÿÿÿN(   t	   deprecate(   t   Versiont	   BindErrorc           B   s   e  Z d  Z d „  Z RS(   s)   An error occurred binding to an interfacec         C   s?   |  j  } |  j r1 d | d j |  j ƒ f } n  d | } | S(   Ns   %s: %st    s   %s.(   t   __doc__t   argst   join(   t   selft   s(    (    s:   /usr/lib/python2.7/dist-packages/twisted/internet/error.pyt   __str__   s
    		
(   t   __name__t
   __module__R   R	   (    (    (    s:   /usr/lib/python2.7/dist-packages/twisted/internet/error.pyR      s   t   CannotListenErrorc           B   s    e  Z d  Z d „  Z d „  Z RS(   s2  
    This gets raised by a call to startListening, when the object cannotstart
    listening.

    @ivar interface: the interface I tried to listen on
    @ivar port: the port I tried to listen on
    @ivar socketError: the exception I got when I tried to listen
    @type socketError: L{socket.error}
    c         C   s5   t  j |  | | | ƒ | |  _ | |  _ | |  _ d  S(   N(   R   t   __init__t	   interfacet   portt   socketError(   R   R   R   R   (    (    s:   /usr/lib/python2.7/dist-packages/twisted/internet/error.pyR   '   s    		c         C   s&   |  j  p d } d | |  j |  j f S(   Nt   anys   Couldn't listen on %s:%s: %s.(   R   R   R   (   R   t   iface(    (    s:   /usr/lib/python2.7/dist-packages/twisted/internet/error.pyR	   -   s    (   R
   R   R   R   R	   (    (    (    s:   /usr/lib/python2.7/dist-packages/twisted/internet/error.pyR      s   		t   MulticastJoinErrorc           B   s   e  Z d  Z RS(   s6   
    An attempt to join a multicast group failed.
    (   R
   R   R   (    (    (    s:   /usr/lib/python2.7/dist-packages/twisted/internet/error.pyR   4   s   t   MessageLengthErrorc           B   s   e  Z d  Z d „  Z RS(   s   Message is too long to sendc         C   s?   |  j  } |  j r1 d | d j |  j ƒ f } n  d | } | S(   Ns   %s: %sR   s   %s.(   R   R   R   (   R   R   (    (    s:   /usr/lib/python2.7/dist-packages/twisted/internet/error.pyR	   >   s
    		
(   R
   R   R   R	   (    (    (    s:   /usr/lib/python2.7/dist-packages/twisted/internet/error.pyR   ;   s   t   DNSLookupErrorc           B   s   e  Z d  Z d „  Z RS(   s   DNS lookup failedc         C   s?   |  j  } |  j r1 d | d j |  j ƒ f } n  d | } | S(   Ns   %s: %sR   s   %s.(   R   R   R   (   R   R   (    (    s:   /usr/lib/python2.7/dist-packages/twisted/internet/error.pyR	   J   s
    		
(   R
   R   R   R	   (    (    (    s:   /usr/lib/python2.7/dist-packages/twisted/internet/error.pyR   G   s   t   ConnectInProgressErrorc           B   s   e  Z d  Z RS(   s3   A connect operation was started and isn't done yet.(   R
   R   R   (    (    (    s:   /usr/lib/python2.7/dist-packages/twisted/internet/error.pyR   S   s   t   ConnectErrorc           B   s&   e  Z d  Z d d d „ Z d „  Z RS(   s"   An error occurred while connectingt    c         C   s   | |  _  t j |  | ƒ d  S(   N(   t   osErrort	   ExceptionR   (   R   R   t   string(    (    s:   /usr/lib/python2.7/dist-packages/twisted/internet/error.pyR   \   s    	c         C   sc   |  j  p |  j j } |  j r4 d | |  j f } n  |  d rU d | |  d f } n  d | } | S(   Ns   %s: %si    s   %s.(   R   t	   __class__R
   R   (   R   R   (    (    s:   /usr/lib/python2.7/dist-packages/twisted/internet/error.pyR	   `   s    	

N(   R
   R   R   t   NoneR   R	   (    (    (    s:   /usr/lib/python2.7/dist-packages/twisted/internet/error.pyR   Y   s   t   ConnectBindErrorc           B   s   e  Z d  Z RS(   s   Couldn't bind(   R
   R   R   (    (    (    s:   /usr/lib/python2.7/dist-packages/twisted/internet/error.pyR   k   s   t   UnknownHostErrorc           B   s   e  Z d  Z RS(   s   Hostname couldn't be looked up(   R
   R   R   (    (    (    s:   /usr/lib/python2.7/dist-packages/twisted/internet/error.pyR   p   s   t   NoRouteErrorc           B   s   e  Z d  Z RS(   s   No route to host(   R
   R   R   (    (    (    s:   /usr/lib/python2.7/dist-packages/twisted/internet/error.pyR    u   s   t   ConnectionRefusedErrorc           B   s   e  Z d  Z RS(   s$   Connection was refused by other side(   R
   R   R   (    (    (    s:   /usr/lib/python2.7/dist-packages/twisted/internet/error.pyR!   z   s   t   TCPTimedOutErrorc           B   s   e  Z d  Z RS(   s   TCP connection timed out(   R
   R   R   (    (    (    s:   /usr/lib/python2.7/dist-packages/twisted/internet/error.pyR"      s   t   BadFileErrorc           B   s   e  Z d  Z RS(   s$   File used for UNIX socket is no good(   R
   R   R   (    (    (    s:   /usr/lib/python2.7/dist-packages/twisted/internet/error.pyR#   „   s   t   ServiceNameUnknownErrorc           B   s   e  Z d  Z RS(   s%   Service name given as port is unknown(   R
   R   R   (    (    (    s:   /usr/lib/python2.7/dist-packages/twisted/internet/error.pyR$   ‰   s   t	   UserErrorc           B   s   e  Z d  Z RS(   s   User aborted connection(   R
   R   R   (    (    (    s:   /usr/lib/python2.7/dist-packages/twisted/internet/error.pyR%   Ž   s   t   TimeoutErrorc           B   s   e  Z d  Z RS(   s&   User timeout caused connection failure(   R
   R   R   (    (    (    s:   /usr/lib/python2.7/dist-packages/twisted/internet/error.pyR&   “   s   t   SSLErrorc           B   s   e  Z d  Z RS(   s   An SSL error occurred(   R
   R   R   (    (    (    s:   /usr/lib/python2.7/dist-packages/twisted/internet/error.pyR'   ˜   s   t   VerifyErrorc           B   s   e  Z d  Z RS(   s?   Could not verify something that was supposed to be signed.
    (   R
   R   R   (    (    (    s:   /usr/lib/python2.7/dist-packages/twisted/internet/error.pyR(      s   t   PeerVerifyErrorc           B   s   e  Z d  Z RS(   s(   The peer rejected our verify error.
    (   R
   R   R   (    (    (    s:   /usr/lib/python2.7/dist-packages/twisted/internet/error.pyR)   £   s   t   CertificateErrorc           B   s   e  Z d  Z RS(   sF   
    We did not find a certificate where we expected to find one.
    (   R
   R   R   (    (    (    s:   /usr/lib/python2.7/dist-packages/twisted/internet/error.pyR*   ©   s   t   WSAECONNREFUSEDc         C   sw   y |  \ } } Wn t  k
 r- t d |  ƒ SXt t d ƒ rX t |  t j ƒ rX t } n t j | t ƒ } | | | ƒ S(   s2   Given a socket exception, return connection error.R   t   gaierror(	   t
   ValueErrorR   t   hasattrt   sockett
   isinstanceR,   R   t   errnoMappingt   get(   t   et   numberR   t   klass(    (    s:   /usr/lib/python2.7/dist-packages/twisted/internet/error.pyt   getConnectError¿   s    !	t   ConnectionClosedc           B   s   e  Z d  Z RS(   s@   
    Connection was closed, whether cleanly or non-cleanly.
    (   R
   R   R   (    (    (    s:   /usr/lib/python2.7/dist-packages/twisted/internet/error.pyR7   Ï   s   t   ConnectionLostc           B   s   e  Z d  Z d „  Z RS(   s<   Connection to the other side was lost in a non-clean fashionc         C   s?   |  j  } |  j r1 d | d j |  j ƒ f } n  d | } | S(   Ns   %s: %sR   s   %s.(   R   R   R   (   R   R   (    (    s:   /usr/lib/python2.7/dist-packages/twisted/internet/error.pyR	   Ù   s
    		
(   R
   R   R   R	   (    (    (    s:   /usr/lib/python2.7/dist-packages/twisted/internet/error.pyR8   Ö   s   t   ConnectionDonec           B   s   e  Z d  Z d „  Z RS(   s   Connection was closed cleanlyc         C   s?   |  j  } |  j r1 d | d j |  j ƒ f } n  d | } | S(   Ns   %s: %sR   s   %s.(   R   R   R   (   R   R   (    (    s:   /usr/lib/python2.7/dist-packages/twisted/internet/error.pyR	   å   s
    		
(   R
   R   R   R	   (    (    (    s:   /usr/lib/python2.7/dist-packages/twisted/internet/error.pyR9   â   s   t   ConnectionFdescWentAwayc           B   s   e  Z d  Z RS(   t   Uh(   R
   R   R   (    (    (    s:   /usr/lib/python2.7/dist-packages/twisted/internet/error.pyR:   î   s   t   AlreadyCalledc           B   s   e  Z d  Z d „  Z RS(   s'   Tried to cancel an already-called eventc         C   s?   |  j  } |  j r1 d | d j |  j ƒ f } n  d | } | S(   Ns   %s: %sR   s   %s.(   R   R   R   (   R   R   (    (    s:   /usr/lib/python2.7/dist-packages/twisted/internet/error.pyR	   ö   s
    		
(   R
   R   R   R	   (    (    (    s:   /usr/lib/python2.7/dist-packages/twisted/internet/error.pyR<   ó   s   t   AlreadyCancelledc           B   s   e  Z d  Z d „  Z RS(   s*   Tried to cancel an already-cancelled eventc         C   s?   |  j  } |  j r1 d | d j |  j ƒ f } n  d | } | S(   Ns   %s: %sR   s   %s.(   R   R   R   (   R   R   (    (    s:   /usr/lib/python2.7/dist-packages/twisted/internet/error.pyR	     s
    		
(   R
   R   R   R	   (    (    (    s:   /usr/lib/python2.7/dist-packages/twisted/internet/error.pyR=   ÿ   s   t   PotentialZombieWarningc           B   s   e  Z d  Z d Z RS(   s¿   
    Emitted when L{IReactorProcess.spawnProcess} is called in a way which may
    result in termination of the created child process not being reported.

    Deprecated in Twisted 10.0.
    sû   spawnProcess called, but the SIGCHLD handler is not installed. This probably means you have not yet called reactor.run, or called reactor.run(installSignalHandler=0). You will probably never see this process finish, and it may become a zombie process.(   R
   R   R   t   MESSAGE(    (    (    s:   /usr/lib/python2.7/dist-packages/twisted/internet/error.pyR>     s   t   Twistedi
   i    s4   There is no longer any potential for zombie process.t   ProcessDonec           B   s   e  Z d  Z d „  Z RS(   s+   A process has ended without apparent errorsc         C   s/   t  j |  d ƒ d |  _ d  |  _ | |  _ d  S(   Ns!   process finished with exit code 0i    (   R   R   t   exitCodeR   t   signalt   status(   R   RD   (    (    s:   /usr/lib/python2.7/dist-packages/twisted/internet/error.pyR   %  s    		(   R
   R   R   R   (    (    (    s:   /usr/lib/python2.7/dist-packages/twisted/internet/error.pyRA   "  s   t   ProcessTerminatedc           B   s    e  Z d  Z d d d d „ Z RS(   s3   A process has ended with a probable error conditionc         C   so   | |  _  | |  _ | |  _ d } | d  k	 r> | d | } n  | d  k	 r[ | d | } n  t j |  | ƒ d  S(   Ns   process endeds    with exit code %ss    by signal %s(   RB   RC   RD   R   R   R   (   R   RB   RC   RD   R   (    (    s:   /usr/lib/python2.7/dist-packages/twisted/internet/error.pyR   0  s    			  N(   R
   R   R   R   R   (    (    (    s:   /usr/lib/python2.7/dist-packages/twisted/internet/error.pyRE   -  s   t   ProcessExitedAlreadyc           B   s   e  Z d  Z RS(   sd   
    The process has already exited and the operation requested can no longer
    be performed.
    (   R
   R   R   (    (    (    s:   /usr/lib/python2.7/dist-packages/twisted/internet/error.pyRF   ;  s   t   NotConnectingErrorc           B   s   e  Z d  Z d „  Z RS(   sE   The Connector was not connecting when it was asked to stop connectingc         C   s?   |  j  } |  j r1 d | d j |  j ƒ f } n  d | } | S(   Ns   %s: %sR   s   %s.(   R   R   R   (   R   R   (    (    s:   /usr/lib/python2.7/dist-packages/twisted/internet/error.pyR	   F  s
    		
(   R
   R   R   R	   (    (    (    s:   /usr/lib/python2.7/dist-packages/twisted/internet/error.pyRG   C  s   t   NotListeningErrorc           B   s   e  Z d  Z d „  Z RS(   s>   The Port was not listening when it was asked to stop listeningc         C   s?   |  j  } |  j r1 d | d j |  j ƒ f } n  d | } | S(   Ns   %s: %sR   s   %s.(   R   R   R   (   R   R   (    (    s:   /usr/lib/python2.7/dist-packages/twisted/internet/error.pyR	   R  s
    		
(   R
   R   R   R	   (    (    (    s:   /usr/lib/python2.7/dist-packages/twisted/internet/error.pyRH   O  s   t   ReactorNotRunningc           B   s   e  Z d  Z RS(   sJ   
    Error raised when trying to stop a reactor which is not running.
    (   R
   R   R   (    (    (    s:   /usr/lib/python2.7/dist-packages/twisted/internet/error.pyRI   [  s   t   ReactorNotRestartablec           B   s   e  Z d  Z RS(   sF   
    Error raised when trying to run a reactor which was stopped.
    (   R
   R   R   (    (    (    s:   /usr/lib/python2.7/dist-packages/twisted/internet/error.pyRJ   a  s   t   ReactorAlreadyRunningc           B   s   e  Z d  Z RS(   sG   
    Error raised when trying to start the reactor multiple times.
    (   R
   R   R   (    (    (    s:   /usr/lib/python2.7/dist-packages/twisted/internet/error.pyRK   h  s   t   ReactorAlreadyInstalledErrorc           B   s   e  Z d  Z RS(   sE   
    Could not install reactor because one is already installed.
    (   R
   R   R   (    (    (    s:   /usr/lib/python2.7/dist-packages/twisted/internet/error.pyRL   n  s   t   ConnectingCancelledErrorc           B   s   e  Z d  Z d „  Z RS(   sâ   
    An C{Exception} that will be raised when an L{IStreamClientEndpoint} is
    cancelled before it connects.

    @ivar address: The L{IAddress} that is the destination of the
        cancelled L{IStreamClientEndpoint}.
    c         C   s   t  j |  | ƒ | |  _ d S(   s‰   
        @param address: The L{IAddress} that is the destination of the
            L{IStreamClientEndpoint} that was cancelled.
        N(   R   R   t   address(   R   RN   (    (    s:   /usr/lib/python2.7/dist-packages/twisted/internet/error.pyR   ~  s    (   R
   R   R   R   (    (    (    s:   /usr/lib/python2.7/dist-packages/twisted/internet/error.pyRM   u  s   R6   (>   R   R/   t   twisted.pythonR    t   twisted.python.versionsR   R   R   R   R   R   t   IOErrorR   R   R   R   R   R    R!   R"   R#   R$   R%   R&   R'   R(   R)   R*   t   errnot   ENETUNREACHt   ECONNREFUSEDt	   ETIMEDOUTR1   R.   R+   t   WSAENETUNREACHt   ImportErrorR6   R7   R8   R9   R:   R-   R<   R=   t   WarningR>   t   deprecatedModuleAttributeR
   RA   RE   RF   t   RuntimeErrorRG   RH   RI   RJ   RK   t   AssertionErrorRL   RM   t   __all__(    (    (    s:   /usr/lib/python2.7/dist-packages/twisted/internet/error.pyt   <module>   sŠ   


										