Ticket #4685: resolver-docs-4685-2.patch

File resolver-docs-4685-2.patch, 4.5 KB (added by Richard Wall, 7 years ago)

An updated patch containing documentation mods for just two IResolver methods

  • twisted/internet/interfaces.py

    === modified file 'twisted/internet/interfaces.py'
     
    7676        """
    7777
    7878class IResolver(IResolverSimple):
    79     def query(query, timeout = 10):
    80         """
    81         Interpret and dispatch a query object to the appropriate
    82         lookup* method.
    83         """
    84 
    85     def lookupAddress(name, timeout = 10):
    86         """
    87         Lookup the A records associated with C{name}.
     79    def query(query, timeout=10):
     80        """
     81        Dispatch C{query} to the method which can handle its type.
     82
     83        @type query: L{twisted.names.dns.Query}
     84        @param query: The DNS query being issued, to which a response is to be
     85            generated.
     86
     87        @type timeout: Sequence of C{int}
     88        @param timeout: Number of seconds after which to reissue the query.
     89            When the last timeout expires, the query is considered failed.
     90
     91        @rtype: C{Deferred}
     92        @return: A L{Deferred} which fires with a three-tuple of lists of
     93            L{twisted.names.dns.RRHeader} instances.  The first element of the
     94            tuple gives answers.  The second element of the tuple gives
     95            authorities.  The third element of the tuple gives additional
     96            information.  The L{Deferred} may instead fail with one of the
     97            exceptions defined in L{twisted.names.error} or with
     98            C{NotImplementedError}.
     99        """
     100
     101    def lookupAddress(name, timeout=10):
     102        """
     103        Perform an A record lookup.
     104
     105        @type name: C{str}
     106        @param name: DNS name to resolve.
     107
     108        @type timeout: Sequence of C{int}
     109        @param timeout: Number of seconds after which to reissue the query.
     110            When the last timeout expires, the query is considered failed.
     111
     112        @rtype: C{Deferred}
     113        @return: A L{Deferred} which fires with a three-tuple of lists of
     114            L{twisted.names.dns.RRHeader} instances.  The first element of the
     115            tuple gives answers.  The second element of the tuple gives
     116            authorities.  The third element of the tuple gives additional
     117            information.  The L{Deferred} may instead fail with one of the
     118            exceptions defined in L{twisted.names.error} or with
     119            C{NotImplementedError}.
    88120        """
    89121
    90122    def lookupAddress6(name, timeout = 10):
  • twisted/names/client.py

    === modified file 'twisted/names/client.py'
     
    595595
    596596def lookupAddress(name, timeout=None):
    597597    """
    598     Perform an A record lookup.
    599 
    600     @type name: C{str}
    601     @param name: DNS name to resolve.
    602 
    603     @type timeout: Sequence of C{int}
    604     @param timeout: Number of seconds after which to reissue the query.
    605     When the last timeout expires, the query is considered failed.
    606 
    607     @rtype: C{Deferred}
     598    @see: twisted.internet.interfaces.IResolver.lookupAddress
    608599    """
    609600    return getResolver().lookupAddress(name, timeout)
    610601
  • twisted/names/common.py

    === modified file 'twisted/names/common.py'
     
    6060
    6161    def query(self, query, timeout=None):
    6262        """
    63         Dispatch C{query} to the method which can handle its type.
    64 
    65         @param query: The DNS query being issued, to which a response is to be
    66             generated.
    67         @type query: L{twisted.names.dns.Query}
    68 
    69         @return: A L{Deferred} which fires with a three-tuple of lists of
    70             L{twisted.names.dns.RRHeader} instances.  The first element of the
    71             tuple gives answers.  The second element of the tuple gives
    72             authorities.  The third element of the tuple gives additional
    73             information.  The L{Deferred} may instead fail with one of the
    74             exceptions defined in L{twisted.names.error} or with
    75             C{NotImplementedError}.
     63        @see: twisted.internet.interfaces.IResolver.query
    7664        """
    7765        try:
    7866            method = self.typeToMethod[query.type]
     
    8674    def _lookup(self, name, cls, type, timeout):
    8775        return defer.fail(NotImplementedError("ResolverBase._lookup"))
    8876
    89     def lookupAddress(self, name, timeout = None):
     77    def lookupAddress(self, name, timeout=None):
    9078        """
    91         @see: twisted.names.client.lookupAddress
     79        @see: twisted.internet.interfaces.IResolver.lookupAddress
    9280        """
    9381        return self._lookup(name, dns.IN, dns.A, timeout)
    9482