Ë
    oj±  ã                   ó    — d Z ddlmZ ddlmZmZ ddlmZmZm	Z	  G d„ d«      Z
 eej                  «       G d„ dej                  «      «       Zy	)
z´
Lookup a name using multiple resolvers.

Future Plans: This needs someway to specify which resolver answered
the query, or someway to specify (authority|ttl|cache behavior|more?)
é    )Úimplementer)ÚdeferÚ
interfaces)ÚcommonÚdnsÚerrorc                   ó   — e Zd Zd„ Zd„ Zy)ÚFailureHandlerc                 ó.   — || _         || _        || _        y ©N)ÚresolverÚqueryÚtimeout)Úselfr   r   r   s       ú7/usr/lib/python3/dist-packages/twisted/names/resolve.pyÚ__init__zFailureHandler.__init__   s   € Ø ˆŒØˆŒ
Øˆ�ó    c                 ó´   — |j                  t        j                  t        j                  t
        «       | j                  | j                  | j                  «      S r   )	Útrapr   ÚDomainErrorr   ÚTimeoutErrorÚNotImplementedErrorr   r   r   )r   Úfailures     r   Ú__call__zFailureHandler.__call__   s6   € à�‰”S—_‘_¤e×&8Ñ&8Ô:MÔNØ�}‰}˜TŸZ™Z¨¯©Ó6Ð6r   N)Ú__name__Ú
__module__Ú__qualname__r   r   © r   r   r
   r
      s   „ òó
7r   r
   c                   ó$   — e Zd ZdZd„ Zd„ Zdd„Zy)ÚResolverChainz8
    Lookup an address using multiple L{IResolver}s
    c                 óP   — t         j                  j                  | «       || _        y)zi
        @type resolvers: L{list}
        @param resolvers: A L{list} of L{IResolver} providers.
        N)r   ÚResolverBaser   Ú	resolvers)r   r#   s     r   r   zResolverChain.__init__%   s   € ô
 	×Ñ×$Ñ$ TÔ*Ø"ˆ�r   c                 óL  — | j                   s't        j                  t        j                  «       «      S t        j                  |||«      }| j                   d   j                  ||«      }| j                   dd D ](  }|j                  t        |j                  ||«      «      }Œ* |S )aN  
        Build a L{dns.Query} for the given parameters and dispatch it
        to each L{IResolver} in C{self.resolvers} until an answer or
        L{error.AuthoritativeDomainError} is returned.

        @type name: C{str}
        @param name: DNS name to resolve.

        @type type: C{int}
        @param type: DNS record type.

        @type cls: C{int}
        @param cls: DNS record class.

        @type timeout: Sequence of C{int}
        @param timeout: Number of seconds after which to reissue the query.
            When the last timeout expires, the query is considered failed.

        @rtype: L{Deferred}
        @return: A L{Deferred} which fires with a three-tuple of lists of
            L{twisted.names.dns.RRHeader} instances.  The first element of the
            tuple gives answers.  The second element of the tuple gives
            authorities.  The third element of the tuple gives additional
            information.  The L{Deferred} may instead fail with one of the
            exceptions defined in L{twisted.names.error} or with
            C{NotImplementedError}.
        r   é   N)
r#   r   Úfailr   r   r   ÚQueryr   Ú
addErrbackr
   )r   ÚnameÚclsÚtyper   ÚqÚdÚrs           r   Ú_lookupzResolverChain._lookup-   sŒ   € ð8 �~Š~Ü—:‘:œe×/Ñ/Ó1Ó2Ð2Ü�I‰I�d˜D #Ó&ˆØ�N‰N˜1Ñ×#Ñ# A wÓ/ˆØ—‘  Ð#ò 	BˆAØ—‘œ^¨A¯G©G°Q¸Ó@ÓA‰Að	Bàˆr   Nc                 ó  — | j                   s't        j                  t        j                  «       «      S | j                   d   j                  ||«      }| j                   dd  D ](  }|j                  t        |j
                  ||«      «      }Œ* |S )Nr   r%   )r#   r   r&   r   r   ÚlookupAllRecordsr(   r
   )r   r)   r   r-   r.   s        r   r1   zResolverChain.lookupAllRecordsQ   s|   € ð
 �~Š~Ü—:‘:œe×/Ñ/Ó1Ó2Ð2Ø�N‰N˜1Ñ×.Ñ.¨t°WÓ=ˆØ—‘  Ð#ò 	PˆAØ—‘œ^¨A×,>Ñ,>ÀÀgÓNÓO‰Að	Pàˆr   r   )r   r   r   Ú__doc__r   r/   r1   r   r   r   r    r       s   „ ñò#ò"ôH
r   r    N)r2   Úzope.interfacer   Útwisted.internetr   r   Útwisted.namesr   r   r   r
   Ú	IResolverr"   r    r   r   r   ú<module>r7      sN   ðñ
õ 'ç .ß ,Ñ ,÷	7ñ 	7ñ ˆZ×!Ñ!Ó"ô;�F×'Ñ'ó ;ó #ñ;r   