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

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

All the lookup methods given the same treatment as in previous patch.

  • 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}.
    88         """
    89 
    90     def lookupAddress6(name, timeout = 10):
    91         """
    92         Lookup all the A6 records associated with C{name}.
    93         """
    94 
    95     def lookupIPV6Address(name, timeout = 10):
    96         """
    97         Lookup all the AAAA records associated with C{name}.
    98         """
    99 
    100     def lookupMailExchange(name, timeout = 10):
    101         """
    102         Lookup the MX records associated with C{name}.
    103         """
    104 
    105     def lookupNameservers(name, timeout = 10):
    106         """
    107         Lookup the the NS records associated with C{name}.
    108         """
    109 
    110     def lookupCanonicalName(name, timeout = 10):
    111         """
    112         Lookup the CNAME records associated with C{name}.
    113         """
    114 
    115     def lookupMailBox(name, timeout = 10):
    116         """
    117         Lookup the MB records associated with C{name}.
    118         """
    119 
    120     def lookupMailGroup(name, timeout = 10):
    121         """
    122         Lookup the MG records associated with C{name}.
    123         """
    124 
    125     def lookupMailRename(name, timeout = 10):
    126         """
    127         Lookup the MR records associated with C{name}.
    128         """
    129 
    130     def lookupPointer(name, timeout = 10):
    131         """
    132         Lookup the PTR records associated with C{name}.
    133         """
    134 
    135     def lookupAuthority(name, timeout = 10):
    136         """
    137         Lookup the SOA records associated with C{name}.
    138         """
    139 
    140     def lookupNull(name, timeout = 10):
    141         """
    142         Lookup the NULL records associated with C{name}.
    143         """
    144 
    145     def lookupWellKnownServices(name, timeout = 10):
    146         """
    147         Lookup the WKS records associated with C{name}.
    148         """
    149 
    150     def lookupHostInfo(name, timeout = 10):
    151         """
    152         Lookup the HINFO records associated with C{name}.
    153         """
    154 
    155     def lookupMailboxInfo(name, timeout = 10):
    156         """
    157         Lookup the MINFO records associated with C{name}.
    158         """
    159 
    160     def lookupText(name, timeout = 10):
    161         """
    162         Lookup the TXT records associated with C{name}.
    163         """
    164 
    165     def lookupResponsibility(name, timeout = 10):
    166         """
    167         Lookup the RP records associated with C{name}.
    168         """
    169 
    170     def lookupAFSDatabase(name, timeout = 10):
    171         """
    172         Lookup the AFSDB records associated with C{name}.
    173         """
    174 
    175     def lookupService(name, timeout = 10):
    176         """
    177         Lookup the SRV records associated with C{name}.
    178         """
    179 
    180     def lookupAllRecords(name, timeout = 10):
    181         """
    182         Lookup all records associated with C{name}.
    183         """
    184 
    185     def lookupZone(name, timeout = 10):
    186         """
    187         Perform a zone transfer for the given C{name}.
     79    def query(query, timeout=None):
     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=None):
     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}.
     120        """
     121
     122    def lookupAddress6(name, timeout=None):
     123        """
     124        Perform an A6 record lookup.
     125
     126        @type name: C{str}
     127        @param name: DNS name to resolve.
     128
     129        @type timeout: Sequence of C{int}
     130        @param timeout: Number of seconds after which to reissue the query.
     131            When the last timeout expires, the query is considered failed.
     132
     133        @rtype: C{Deferred}
     134        @return: A L{Deferred} which fires with a three-tuple of lists of
     135            L{twisted.names.dns.RRHeader} instances.  The first element of the
     136            tuple gives answers.  The second element of the tuple gives
     137            authorities.  The third element of the tuple gives additional
     138            information.  The L{Deferred} may instead fail with one of the
     139            exceptions defined in L{twisted.names.error} or with
     140            C{NotImplementedError}.
     141        """
     142
     143    def lookupIPV6Address(name, timeout=None):
     144        """
     145        Perform an AAAA record lookup.
     146
     147        @type name: C{str}
     148        @param name: DNS name to resolve.
     149
     150        @type timeout: Sequence of C{int}
     151        @param timeout: Number of seconds after which to reissue the query.
     152            When the last timeout expires, the query is considered failed.
     153
     154        @rtype: C{Deferred}
     155        @return: A L{Deferred} which fires with a three-tuple of lists of
     156            L{twisted.names.dns.RRHeader} instances.  The first element of the
     157            tuple gives answers.  The second element of the tuple gives
     158            authorities.  The third element of the tuple gives additional
     159            information.  The L{Deferred} may instead fail with one of the
     160            exceptions defined in L{twisted.names.error} or with
     161            C{NotImplementedError}.
     162        """
     163
     164    def lookupMailExchange(name, timeout=None):
     165        """
     166        Perform an MX record lookup.
     167
     168        @type name: C{str}
     169        @param name: DNS name to resolve.
     170
     171        @type timeout: Sequence of C{int}
     172        @param timeout: Number of seconds after which to reissue the query.
     173            When the last timeout expires, the query is considered failed.
     174
     175        @rtype: C{Deferred}
     176        @return: A L{Deferred} which fires with a three-tuple of lists of
     177            L{twisted.names.dns.RRHeader} instances.  The first element of the
     178            tuple gives answers.  The second element of the tuple gives
     179            authorities.  The third element of the tuple gives additional
     180            information.  The L{Deferred} may instead fail with one of the
     181            exceptions defined in L{twisted.names.error} or with
     182            C{NotImplementedError}.
     183        """
     184
     185    def lookupNameservers(name, timeout=None):
     186        """
     187        Perform an NS record lookup.
     188
     189        @type name: C{str}
     190        @param name: DNS name to resolve.
     191
     192        @type timeout: Sequence of C{int}
     193        @param timeout: Number of seconds after which to reissue the query.
     194            When the last timeout expires, the query is considered failed.
     195
     196        @rtype: C{Deferred}
     197        @return: A L{Deferred} which fires with a three-tuple of lists of
     198            L{twisted.names.dns.RRHeader} instances.  The first element of the
     199            tuple gives answers.  The second element of the tuple gives
     200            authorities.  The third element of the tuple gives additional
     201            information.  The L{Deferred} may instead fail with one of the
     202            exceptions defined in L{twisted.names.error} or with
     203            C{NotImplementedError}.
     204        """
     205
     206    def lookupCanonicalName(name, timeout=None):
     207        """
     208        Perform a CNAME record lookup.
     209
     210        @type name: C{str}
     211        @param name: DNS name to resolve.
     212
     213        @type timeout: Sequence of C{int}
     214        @param timeout: Number of seconds after which to reissue the query.
     215            When the last timeout expires, the query is considered failed.
     216
     217        @rtype: C{Deferred}
     218        @return: A L{Deferred} which fires with a three-tuple of lists of
     219            L{twisted.names.dns.RRHeader} instances.  The first element of the
     220            tuple gives answers.  The second element of the tuple gives
     221            authorities.  The third element of the tuple gives additional
     222            information.  The L{Deferred} may instead fail with one of the
     223            exceptions defined in L{twisted.names.error} or with
     224            C{NotImplementedError}.
     225        """
     226
     227    def lookupMailBox(name, timeout=None):
     228        """
     229        Perform an MB record lookup.
     230
     231        @type name: C{str}
     232        @param name: DNS name to resolve.
     233
     234        @type timeout: Sequence of C{int}
     235        @param timeout: Number of seconds after which to reissue the query.
     236            When the last timeout expires, the query is considered failed.
     237
     238        @rtype: C{Deferred}
     239        @return: A L{Deferred} which fires with a three-tuple of lists of
     240            L{twisted.names.dns.RRHeader} instances.  The first element of the
     241            tuple gives answers.  The second element of the tuple gives
     242            authorities.  The third element of the tuple gives additional
     243            information.  The L{Deferred} may instead fail with one of the
     244            exceptions defined in L{twisted.names.error} or with
     245            C{NotImplementedError}.
     246        """
     247
     248    def lookupMailGroup(name, timeout=None):
     249        """
     250        Perform an MG record lookup.
     251
     252        @type name: C{str}
     253        @param name: DNS name to resolve.
     254
     255        @type timeout: Sequence of C{int}
     256        @param timeout: Number of seconds after which to reissue the query.
     257            When the last timeout expires, the query is considered failed.
     258
     259        @rtype: C{Deferred}
     260        @return: A L{Deferred} which fires with a three-tuple of lists of
     261            L{twisted.names.dns.RRHeader} instances.  The first element of the
     262            tuple gives answers.  The second element of the tuple gives
     263            authorities.  The third element of the tuple gives additional
     264            information.  The L{Deferred} may instead fail with one of the
     265            exceptions defined in L{twisted.names.error} or with
     266            C{NotImplementedError}.
     267        """
     268
     269    def lookupMailRename(name, timeout=None):
     270        """
     271        Perform an MR record lookup.
     272
     273        @type name: C{str}
     274        @param name: DNS name to resolve.
     275
     276        @type timeout: Sequence of C{int}
     277        @param timeout: Number of seconds after which to reissue the query.
     278            When the last timeout expires, the query is considered failed.
     279
     280        @rtype: C{Deferred}
     281        @return: A L{Deferred} which fires with a three-tuple of lists of
     282            L{twisted.names.dns.RRHeader} instances.  The first element of the
     283            tuple gives answers.  The second element of the tuple gives
     284            authorities.  The third element of the tuple gives additional
     285            information.  The L{Deferred} may instead fail with one of the
     286            exceptions defined in L{twisted.names.error} or with
     287            C{NotImplementedError}.
     288        """
     289
     290    def lookupPointer(name, timeout=None):
     291        """
     292        Perform a PTR record lookup.
     293
     294        @type name: C{str}
     295        @param name: DNS name to resolve.
     296
     297        @type timeout: Sequence of C{int}
     298        @param timeout: Number of seconds after which to reissue the query.
     299            When the last timeout expires, the query is considered failed.
     300
     301        @rtype: C{Deferred}
     302        @return: A L{Deferred} which fires with a three-tuple of lists of
     303            L{twisted.names.dns.RRHeader} instances.  The first element of the
     304            tuple gives answers.  The second element of the tuple gives
     305            authorities.  The third element of the tuple gives additional
     306            information.  The L{Deferred} may instead fail with one of the
     307            exceptions defined in L{twisted.names.error} or with
     308            C{NotImplementedError}.
     309        """
     310
     311    def lookupAuthority(name, timeout=None):
     312        """
     313        Perform an SOA record lookup.
     314
     315        @type name: C{str}
     316        @param name: DNS name to resolve.
     317
     318        @type timeout: Sequence of C{int}
     319        @param timeout: Number of seconds after which to reissue the query.
     320            When the last timeout expires, the query is considered failed.
     321
     322        @rtype: C{Deferred}
     323        @return: A L{Deferred} which fires with a three-tuple of lists of
     324            L{twisted.names.dns.RRHeader} instances.  The first element of the
     325            tuple gives answers.  The second element of the tuple gives
     326            authorities.  The third element of the tuple gives additional
     327            information.  The L{Deferred} may instead fail with one of the
     328            exceptions defined in L{twisted.names.error} or with
     329            C{NotImplementedError}.
     330        """
     331
     332    def lookupNull(name, timeout=None):
     333        """
     334        Perform a NULL record lookup.
     335
     336        @type name: C{str}
     337        @param name: DNS name to resolve.
     338
     339        @type timeout: Sequence of C{int}
     340        @param timeout: Number of seconds after which to reissue the query.
     341            When the last timeout expires, the query is considered failed.
     342
     343        @rtype: C{Deferred}
     344        @return: A L{Deferred} which fires with a three-tuple of lists of
     345            L{twisted.names.dns.RRHeader} instances.  The first element of the
     346            tuple gives answers.  The second element of the tuple gives
     347            authorities.  The third element of the tuple gives additional
     348            information.  The L{Deferred} may instead fail with one of the
     349            exceptions defined in L{twisted.names.error} or with
     350            C{NotImplementedError}.
     351        """
     352
     353    def lookupWellKnownServices(name, timeout=None):
     354        """
     355        Perform a WKS record lookup.
     356
     357        @type name: C{str}
     358        @param name: DNS name to resolve.
     359
     360        @type timeout: Sequence of C{int}
     361        @param timeout: Number of seconds after which to reissue the query.
     362            When the last timeout expires, the query is considered failed.
     363
     364        @rtype: C{Deferred}
     365        @return: A L{Deferred} which fires with a three-tuple of lists of
     366            L{twisted.names.dns.RRHeader} instances.  The first element of the
     367            tuple gives answers.  The second element of the tuple gives
     368            authorities.  The third element of the tuple gives additional
     369            information.  The L{Deferred} may instead fail with one of the
     370            exceptions defined in L{twisted.names.error} or with
     371            C{NotImplementedError}.
     372        """
     373
     374    def lookupHostInfo(name, timeout=None):
     375        """
     376        Perform a HINFO record lookup.
     377
     378        @type name: C{str}
     379        @param name: DNS name to resolve.
     380
     381        @type timeout: Sequence of C{int}
     382        @param timeout: Number of seconds after which to reissue the query.
     383            When the last timeout expires, the query is considered failed.
     384
     385        @rtype: C{Deferred}
     386        @return: A L{Deferred} which fires with a three-tuple of lists of
     387            L{twisted.names.dns.RRHeader} instances.  The first element of the
     388            tuple gives answers.  The second element of the tuple gives
     389            authorities.  The third element of the tuple gives additional
     390            information.  The L{Deferred} may instead fail with one of the
     391            exceptions defined in L{twisted.names.error} or with
     392            C{NotImplementedError}.
     393        """
     394
     395    def lookupMailboxInfo(name, timeout=None):
     396        """
     397        Perform an MINFO record lookup.
     398
     399        @type name: C{str}
     400        @param name: DNS name to resolve.
     401
     402        @type timeout: Sequence of C{int}
     403        @param timeout: Number of seconds after which to reissue the query.
     404            When the last timeout expires, the query is considered failed.
     405
     406        @rtype: C{Deferred}
     407        @return: A L{Deferred} which fires with a three-tuple of lists of
     408            L{twisted.names.dns.RRHeader} instances.  The first element of the
     409            tuple gives answers.  The second element of the tuple gives
     410            authorities.  The third element of the tuple gives additional
     411            information.  The L{Deferred} may instead fail with one of the
     412            exceptions defined in L{twisted.names.error} or with
     413            C{NotImplementedError}.
     414        """
     415
     416    def lookupText(name, timeout=None):
     417        """
     418        Perform a TXT record lookup.
     419
     420        @type name: C{str}
     421        @param name: DNS name to resolve.
     422
     423        @type timeout: Sequence of C{int}
     424        @param timeout: Number of seconds after which to reissue the query.
     425            When the last timeout expires, the query is considered failed.
     426
     427        @rtype: C{Deferred}
     428        @return: A L{Deferred} which fires with a three-tuple of lists of
     429            L{twisted.names.dns.RRHeader} instances.  The first element of the
     430            tuple gives answers.  The second element of the tuple gives
     431            authorities.  The third element of the tuple gives additional
     432            information.  The L{Deferred} may instead fail with one of the
     433            exceptions defined in L{twisted.names.error} or with
     434            C{NotImplementedError}.
     435        """
     436
     437    def lookupResponsibility(name, timeout=None):
     438        """
     439        Perform an RP record lookup.
     440
     441        @type name: C{str}
     442        @param name: DNS name to resolve.
     443
     444        @type timeout: Sequence of C{int}
     445        @param timeout: Number of seconds after which to reissue the query.
     446            When the last timeout expires, the query is considered failed.
     447
     448        @rtype: C{Deferred}
     449        @return: A L{Deferred} which fires with a three-tuple of lists of
     450            L{twisted.names.dns.RRHeader} instances.  The first element of the
     451            tuple gives answers.  The second element of the tuple gives
     452            authorities.  The third element of the tuple gives additional
     453            information.  The L{Deferred} may instead fail with one of the
     454            exceptions defined in L{twisted.names.error} or with
     455            C{NotImplementedError}.
     456        """
     457
     458    def lookupAFSDatabase(name, timeout=None):
     459        """
     460        Perform an AFSDB record lookup.
     461
     462        @type name: C{str}
     463        @param name: DNS name to resolve.
     464
     465        @type timeout: Sequence of C{int}
     466        @param timeout: Number of seconds after which to reissue the query.
     467            When the last timeout expires, the query is considered failed.
     468
     469        @rtype: C{Deferred}
     470        @return: A L{Deferred} which fires with a three-tuple of lists of
     471            L{twisted.names.dns.RRHeader} instances.  The first element of the
     472            tuple gives answers.  The second element of the tuple gives
     473            authorities.  The third element of the tuple gives additional
     474            information.  The L{Deferred} may instead fail with one of the
     475            exceptions defined in L{twisted.names.error} or with
     476            C{NotImplementedError}.
     477        """
     478
     479    def lookupService(name, timeout=None):
     480        """
     481        Perform an SRV record lookup.
     482
     483        @type name: C{str}
     484        @param name: DNS name to resolve.
     485
     486        @type timeout: Sequence of C{int}
     487        @param timeout: Number of seconds after which to reissue the query.
     488            When the last timeout expires, the query is considered failed.
     489
     490        @rtype: C{Deferred}
     491        @return: A L{Deferred} which fires with a three-tuple of lists of
     492            L{twisted.names.dns.RRHeader} instances.  The first element of the
     493            tuple gives answers.  The second element of the tuple gives
     494            authorities.  The third element of the tuple gives additional
     495            information.  The L{Deferred} may instead fail with one of the
     496            exceptions defined in L{twisted.names.error} or with
     497            C{NotImplementedError}.
     498        """
     499
     500    def lookupAllRecords(name, timeout=None):
     501        """
     502        Perform an ALL_RECORD lookup.
     503
     504        @type name: C{str}
     505        @param name: DNS name to resolve.
     506
     507        @type timeout: Sequence of C{int}
     508        @param timeout: Number of seconds after which to reissue the query.
     509            When the last timeout expires, the query is considered failed.
     510
     511        @rtype: C{Deferred}
     512        @return: A L{Deferred} which fires with a three-tuple of lists of
     513            L{twisted.names.dns.RRHeader} instances.  The first element of the
     514            tuple gives answers.  The second element of the tuple gives
     515            authorities.  The third element of the tuple gives additional
     516            information.  The L{Deferred} may instead fail with one of the
     517            exceptions defined in L{twisted.names.error} or with
     518            C{NotImplementedError}.
     519        """
     520
     521    def lookupSenderPolicy(name, timeout= 10):
     522        """
     523        Perform a SPF record lookup.
     524
     525        @type name: C{str}
     526        @param name: DNS name to resolve.
     527
     528        @type timeout: Sequence of C{int}
     529        @param timeout: Number of seconds after which to reissue the query.
     530            When the last timeout expires, the query is considered failed.
     531
     532        @rtype: C{Deferred}
     533        @return: A L{Deferred} which fires with a three-tuple of lists of
     534            L{twisted.names.dns.RRHeader} instances.  The first element of the
     535            tuple gives answers.  The second element of the tuple gives
     536            authorities.  The third element of the tuple gives additional
     537            information.  The L{Deferred} may instead fail with one of the
     538            exceptions defined in L{twisted.names.error} or with
     539            C{NotImplementedError}.
     540        """
     541
     542    def lookupNamingAuthorityPointer(name, timeout=None):
     543        """
     544        Perform a NAPTR record lookup.
     545
     546        @type name: C{str}
     547        @param name: DNS name to resolve.
     548
     549        @type timeout: Sequence of C{int}
     550        @param timeout: Number of seconds after which to reissue the query.
     551            When the last timeout expires, the query is considered failed.
     552
     553        @rtype: C{Deferred}
     554        @return: A L{Deferred} which fires with a three-tuple of lists of
     555            L{twisted.names.dns.RRHeader} instances.  The first element of the
     556            tuple gives answers.  The second element of the tuple gives
     557            authorities.  The third element of the tuple gives additional
     558            information.  The L{Deferred} may instead fail with one of the
     559            exceptions defined in L{twisted.names.error} or with
     560            C{NotImplementedError}.
     561        """
     562
     563    def lookupZone(name, timeout=None):
     564        """
     565        Perform an AXFR record lookup.
     566
     567        # TODO: Check details of the returned deferred result
     568
     569        @type name: C{str}
     570        @param name: DNS name to resolve.
     571
     572        @type timeout: C{int}
     573        @param timeout: When this timeout expires, the query is
     574            considered failed.
     575
     576        @rtype: C{Deferred}
    188577        """
    189578
    190579
  • 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
    611602def lookupIPV6Address(name, timeout=None):
    612603    """
    613     Perform an AAAA record lookup.
    614 
    615     @type name: C{str}
    616     @param name: DNS name to resolve.
    617 
    618     @type timeout: Sequence of C{int}
    619     @param timeout: Number of seconds after which to reissue the query.
    620     When the last timeout expires, the query is considered failed.
    621 
    622     @rtype: C{Deferred}
     604    @see: twisted.internet.interfaces.IResolver.lookupIPV6Address
    623605    """
    624606    return getResolver().lookupIPV6Address(name, timeout)
    625607
    626608def lookupAddress6(name, timeout=None):
    627609    """
    628     Perform an A6 record lookup.
    629 
    630     @type name: C{str}
    631     @param name: DNS name to resolve.
    632 
    633     @type timeout: Sequence of C{int}
    634     @param timeout: Number of seconds after which to reissue the query.
    635     When the last timeout expires, the query is considered failed.
    636 
    637     @rtype: C{Deferred}
     610    @see: twisted.internet.interfaces.IResolver.lookupAddress6
    638611    """
    639612    return getResolver().lookupAddress6(name, timeout)
    640613
    641614def lookupMailExchange(name, timeout=None):
    642615    """
    643     Perform an MX record lookup.
    644 
    645     @type name: C{str}
    646     @param name: DNS name to resolve.
    647 
    648     @type timeout: Sequence of C{int}
    649     @param timeout: Number of seconds after which to reissue the query.
    650     When the last timeout expires, the query is considered failed.
    651 
    652     @rtype: C{Deferred}
     616    @see: twisted.internet.interfaces.IResolver.lookupMailExchange
    653617    """
    654618    return getResolver().lookupMailExchange(name, timeout)
    655619
    656620def lookupNameservers(name, timeout=None):
    657621    """
    658     Perform an NS record lookup.
    659 
    660     @type name: C{str}
    661     @param name: DNS name to resolve.
    662 
    663     @type timeout: Sequence of C{int}
    664     @param timeout: Number of seconds after which to reissue the query.
    665     When the last timeout expires, the query is considered failed.
    666 
    667     @rtype: C{Deferred}
     622    @see: twisted.internet.interfaces.IResolver.lookupNameservers
    668623    """
    669624    return getResolver().lookupNameservers(name, timeout)
    670625
    671626def lookupCanonicalName(name, timeout=None):
    672627    """
    673     Perform a CNAME record lookup.
    674 
    675     @type name: C{str}
    676     @param name: DNS name to resolve.
    677 
    678     @type timeout: Sequence of C{int}
    679     @param timeout: Number of seconds after which to reissue the query.
    680     When the last timeout expires, the query is considered failed.
    681 
    682     @rtype: C{Deferred}
     628    @see: twisted.internet.interfaces.IResolver.lookupCanonicalName
    683629    """
    684630    return getResolver().lookupCanonicalName(name, timeout)
    685631
    686632def lookupMailBox(name, timeout=None):
    687633    """
    688     Perform an MB record lookup.
    689 
    690     @type name: C{str}
    691     @param name: DNS name to resolve.
    692 
    693     @type timeout: Sequence of C{int}
    694     @param timeout: Number of seconds after which to reissue the query.
    695     When the last timeout expires, the query is considered failed.
    696 
    697     @rtype: C{Deferred}
     634    @see: twisted.internet.interfaces.IResolver.lookupMailBox
    698635    """
    699636    return getResolver().lookupMailBox(name, timeout)
    700637
    701638def lookupMailGroup(name, timeout=None):
    702639    """
    703     Perform an MG record lookup.
    704 
    705     @type name: C{str}
    706     @param name: DNS name to resolve.
    707 
    708     @type timeout: Sequence of C{int}
    709     @param timeout: Number of seconds after which to reissue the query.
    710     When the last timeout expires, the query is considered failed.
    711 
    712     @rtype: C{Deferred}
     640    @see: twisted.internet.interfaces.IResolver.lookupMailGroup
    713641    """
    714642    return getResolver().lookupMailGroup(name, timeout)
    715643
    716644def lookupMailRename(name, timeout=None):
    717645    """
    718     Perform an MR record lookup.
    719 
    720     @type name: C{str}
    721     @param name: DNS name to resolve.
    722 
    723     @type timeout: Sequence of C{int}
    724     @param timeout: Number of seconds after which to reissue the query.
    725     When the last timeout expires, the query is considered failed.
    726 
    727     @rtype: C{Deferred}
     646    @see: twisted.internet.interfaces.IResolver.lookupMailRename
    728647    """
    729648    return getResolver().lookupMailRename(name, timeout)
    730649
    731650def lookupPointer(name, timeout=None):
    732651    """
    733     Perform a PTR record lookup.
    734 
    735     @type name: C{str}
    736     @param name: DNS name to resolve.
    737 
    738     @type timeout: Sequence of C{int}
    739     @param timeout: Number of seconds after which to reissue the query.
    740     When the last timeout expires, the query is considered failed.
    741 
    742     @rtype: C{Deferred}
     652    @see: twisted.internet.interfaces.IResolver.lookupPointer
    743653    """
    744654    return getResolver().lookupPointer(name, timeout)
    745655
    746656def lookupAuthority(name, timeout=None):
    747657    """
    748     Perform an SOA record lookup.
    749 
    750     @type name: C{str}
    751     @param name: DNS name to resolve.
    752 
    753     @type timeout: Sequence of C{int}
    754     @param timeout: Number of seconds after which to reissue the query.
    755     When the last timeout expires, the query is considered failed.
    756 
    757     @rtype: C{Deferred}
     658    @see: twisted.internet.interfaces.IResolver.lookupAuthority
    758659    """
    759660    return getResolver().lookupAuthority(name, timeout)
    760661
    761662def lookupNull(name, timeout=None):
    762663    """
    763     Perform a NULL record lookup.
    764 
    765     @type name: C{str}
    766     @param name: DNS name to resolve.
    767 
    768     @type timeout: Sequence of C{int}
    769     @param timeout: Number of seconds after which to reissue the query.
    770     When the last timeout expires, the query is considered failed.
    771 
    772     @rtype: C{Deferred}
     664    @see: twisted.internet.interfaces.IResolver.lookupNull
    773665    """
    774666    return getResolver().lookupNull(name, timeout)
    775667
    776668def lookupWellKnownServices(name, timeout=None):
    777669    """
    778     Perform a WKS record lookup.
    779 
    780     @type name: C{str}
    781     @param name: DNS name to resolve.
    782 
    783     @type timeout: Sequence of C{int}
    784     @param timeout: Number of seconds after which to reissue the query.
    785     When the last timeout expires, the query is considered failed.
    786 
    787     @rtype: C{Deferred}
     670    @see: twisted.internet.interfaces.IResolver.lookupWellKnownServices
    788671    """
    789672    return getResolver().lookupWellKnownServices(name, timeout)
    790673
    791674def lookupService(name, timeout=None):
    792675    """
    793     Perform an SRV record lookup.
    794 
    795     @type name: C{str}
    796     @param name: DNS name to resolve.
    797 
    798     @type timeout: Sequence of C{int}
    799     @param timeout: Number of seconds after which to reissue the query.
    800     When the last timeout expires, the query is considered failed.
    801 
    802     @rtype: C{Deferred}
     676    @see: twisted.internet.interfaces.IResolver.lookupService
    803677    """
    804678    return getResolver().lookupService(name, timeout)
    805679
    806680def lookupHostInfo(name, timeout=None):
    807681    """
    808     Perform a HINFO record lookup.
    809 
    810     @type name: C{str}
    811     @param name: DNS name to resolve.
    812 
    813     @type timeout: Sequence of C{int}
    814     @param timeout: Number of seconds after which to reissue the query.
    815     When the last timeout expires, the query is considered failed.
    816 
    817     @rtype: C{Deferred}
     682    @see: twisted.internet.interfaces.IResolver.lookupHostInfo
    818683    """
    819684    return getResolver().lookupHostInfo(name, timeout)
    820685
    821686def lookupMailboxInfo(name, timeout=None):
    822687    """
    823     Perform an MINFO record lookup.
    824 
    825     @type name: C{str}
    826     @param name: DNS name to resolve.
    827 
    828     @type timeout: Sequence of C{int}
    829     @param timeout: Number of seconds after which to reissue the query.
    830     When the last timeout expires, the query is considered failed.
    831 
    832     @rtype: C{Deferred}
     688    @see: twisted.internet.interfaces.IResolver.lookupMailboxInfo
    833689    """
    834690    return getResolver().lookupMailboxInfo(name, timeout)
    835691
    836692def lookupText(name, timeout=None):
    837693    """
    838     Perform a TXT record lookup.
    839 
    840     @type name: C{str}
    841     @param name: DNS name to resolve.
    842 
    843     @type timeout: Sequence of C{int}
    844     @param timeout: Number of seconds after which to reissue the query.
    845     When the last timeout expires, the query is considered failed.
    846 
    847     @rtype: C{Deferred}
     694    @see: twisted.internet.interfaces.IResolver.lookupText
    848695    """
    849696    return getResolver().lookupText(name, timeout)
    850697
    851698def lookupSenderPolicy(name, timeout=None):
    852699    """
    853     Perform a SPF record lookup.
    854 
    855     @type name: C{str}
    856     @param name: DNS name to resolve.
    857 
    858     @type timeout: Sequence of C{int}
    859     @param timeout: Number of seconds after which to reissue the query.
    860     When the last timeout expires, the query is considered failed.
    861 
    862     @rtype: C{Deferred}
     700    @see: twisted.internet.interfaces.IResolver.lookupSenderPolicy
    863701    """
    864702    return getResolver().lookupSenderPolicy(name, timeout)
    865703
    866704def lookupResponsibility(name, timeout=None):
    867705    """
    868     Perform an RP record lookup.
    869 
    870     @type name: C{str}
    871     @param name: DNS name to resolve.
    872 
    873     @type timeout: Sequence of C{int}
    874     @param timeout: Number of seconds after which to reissue the query.
    875     When the last timeout expires, the query is considered failed.
    876 
    877     @rtype: C{Deferred}
     706    @see: twisted.internet.interfaces.IResolver.lookupResponsibility
    878707    """
    879708    return getResolver().lookupResponsibility(name, timeout)
    880709
    881710def lookupAFSDatabase(name, timeout=None):
    882711    """
    883     Perform an AFSDB record lookup.
    884 
    885     @type name: C{str}
    886     @param name: DNS name to resolve.
    887 
    888     @type timeout: Sequence of C{int}
    889     @param timeout: Number of seconds after which to reissue the query.
    890     When the last timeout expires, the query is considered failed.
    891 
    892     @rtype: C{Deferred}
     712    @see: twisted.internet.interfaces.IResolver.lookupAFSDatabase
    893713    """
    894714    return getResolver().lookupAFSDatabase(name, timeout)
    895715
    896716def lookupZone(name, timeout=None):
    897717    """
    898     Perform an AXFR record lookup.
    899 
    900     @type name: C{str}
    901     @param name: DNS name to resolve.
    902 
    903     @type timeout: C{int}
    904     @param timeout: When this timeout expires, the query is considered failed.
    905 
    906     @rtype: C{Deferred}
     718    @see: twisted.internet.interfaces.IResolver.lookupZone
    907719    """
    908720    # XXX: timeout here is not a list of ints, it is a single int.
    909721    return getResolver().lookupZone(name, timeout)
    910722
    911723def lookupAllRecords(name, timeout=None):
    912724    """
    913     ALL_RECORD lookup.
    914 
    915     @type name: C{str}
    916     @param name: DNS name to resolve.
    917 
    918     @type timeout: Sequence of C{int}
    919     @param timeout: Number of seconds after which to reissue the query.
    920     When the last timeout expires, the query is considered failed.
    921 
    922     @rtype: C{Deferred}
     725    @see: twisted.internet.interfaces.IResolver.lookupAllRecords
    923726    """
    924727    return getResolver().lookupAllRecords(name, timeout)
    925728
     
    927730
    928731def lookupNamingAuthorityPointer(name, timeout=None):
    929732    """
    930     NAPTR lookup.
    931 
    932     @type name: C{str}
    933     @param name: DNS name to resolve.
    934 
    935     @type timeout: Sequence of C{int}
    936     @param timeout: Number of seconds after which to reissue the query.
    937         When the last timeout expires, the query is considered failed.
    938 
    939     @rtype: C{Deferred}
     733    @see: twisted.internet.interfaces.IResolve.lookupNamingAuthorityPointer
    940734    """
    941735    return getResolver().lookupNamingAuthorityPointer(name, timeout)
  • 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
    95     def lookupIPV6Address(self, name, timeout = None):
     83    def lookupIPV6Address(self, name, timeout=None):
    9684        """
    97         @see: twisted.names.client.lookupIPV6Address
     85        @see: twisted.internet.interfaces.IResolver.lookupIPV6Address
    9886        """
    9987        return self._lookup(name, dns.IN, dns.AAAA, timeout)
    10088
    101     def lookupAddress6(self, name, timeout = None):
     89    def lookupAddress6(self, name, timeout=None):
    10290        """
    103         @see: twisted.names.client.lookupAddress6
     91        @see: twisted.internet.interfaces.IResolver.lookupAddress6
    10492        """
    10593        return self._lookup(name, dns.IN, dns.A6, timeout)
    10694
    107     def lookupMailExchange(self, name, timeout = None):
     95    def lookupMailExchange(self, name, timeout=None):
    10896        """
    109         @see: twisted.names.client.lookupMailExchange
     97        @see: twisted.internet.interfaces.IResolver.lookupMailExchange
    11098        """
    11199        return self._lookup(name, dns.IN, dns.MX, timeout)
    112100
    113     def lookupNameservers(self, name, timeout = None):
     101    def lookupNameservers(self, name, timeout=None):
    114102        """
    115         @see: twisted.names.client.lookupNameservers
     103        @see: twisted.internet.interfaces.IResolver.lookupNameservers
    116104        """
    117105        return self._lookup(name, dns.IN, dns.NS, timeout)
    118106
    119     def lookupCanonicalName(self, name, timeout = None):
     107    def lookupCanonicalName(self, name, timeout=None):
    120108        """
    121         @see: twisted.names.client.lookupCanonicalName
     109        @see: twisted.internet.interfaces.IResolver.lookupCanonicalName
    122110        """
    123111        return self._lookup(name, dns.IN, dns.CNAME, timeout)
    124112
    125     def lookupMailBox(self, name, timeout = None):
     113    def lookupMailBox(self, name, timeout=None):
    126114        """
    127         @see: twisted.names.client.lookupMailBox
     115        @see: twisted.internet.interfaces.IResolver.lookupMailBox
    128116        """
    129117        return self._lookup(name, dns.IN, dns.MB, timeout)
    130118
    131     def lookupMailGroup(self, name, timeout = None):
     119    def lookupMailGroup(self, name, timeout=None):
    132120        """
    133         @see: twisted.names.client.lookupMailGroup
     121        @see: twisted.internet.interfaces.IResolver.lookupMailGroup
    134122        """
    135123        return self._lookup(name, dns.IN, dns.MG, timeout)
    136124
    137     def lookupMailRename(self, name, timeout = None):
     125    def lookupMailRename(self, name, timeout=None):
    138126        """
    139         @see: twisted.names.client.lookupMailRename
     127        @see: twisted.internet.interfaces.IResolver.lookupMailRename
    140128        """
    141129        return self._lookup(name, dns.IN, dns.MR, timeout)
    142130
    143     def lookupPointer(self, name, timeout = None):
     131    def lookupPointer(self, name, timeout=None):
    144132        """
    145         @see: twisted.names.client.lookupPointer
     133        @see: twisted.internet.interfaces.IResolver.lookupPointer
    146134        """
    147135        return self._lookup(name, dns.IN, dns.PTR, timeout)
    148136
    149     def lookupAuthority(self, name, timeout = None):
     137    def lookupAuthority(self, name, timeout=None):
    150138        """
    151         @see: twisted.names.client.lookupAuthority
     139        @see: twisted.internet.interfaces.IResolver.lookupAuthority
    152140        """
    153141        return self._lookup(name, dns.IN, dns.SOA, timeout)
    154142
    155     def lookupNull(self, name, timeout = None):
     143    def lookupNull(self, name, timeout=None):
    156144        """
    157         @see: twisted.names.client.lookupNull
     145        @see: twisted.internet.interfaces.IResolver.lookupNull
    158146        """
    159147        return self._lookup(name, dns.IN, dns.NULL, timeout)
    160148
    161     def lookupWellKnownServices(self, name, timeout = None):
     149    def lookupWellKnownServices(self, name, timeout=None):
    162150        """
    163         @see: twisted.names.client.lookupWellKnownServices
     151        @see: twisted.internet.interfaces.IResolver.lookupWellKnownServices
    164152        """
    165153        return self._lookup(name, dns.IN, dns.WKS, timeout)
    166154
    167     def lookupService(self, name, timeout = None):
     155    def lookupService(self, name, timeout=None):
    168156        """
    169         @see: twisted.names.client.lookupService
     157        @see: twisted.internet.interfaces.IResolver.lookupService
    170158        """
    171159        return self._lookup(name, dns.IN, dns.SRV, timeout)
    172160
    173     def lookupHostInfo(self, name, timeout = None):
     161    def lookupHostInfo(self, name, timeout=None):
    174162        """
    175         @see: twisted.names.client.lookupHostInfo
     163        @see: twisted.internet.interfaces.IResolver.lookupHostInfo
    176164        """
    177165        return self._lookup(name, dns.IN, dns.HINFO, timeout)
    178166
    179     def lookupMailboxInfo(self, name, timeout = None):
     167    def lookupMailboxInfo(self, name, timeout=None):
    180168        """
    181         @see: twisted.names.client.lookupMailboxInfo
     169        @see: twisted.internet.interfaces.IResolver.lookupMailboxInfo
    182170        """
    183171        return self._lookup(name, dns.IN, dns.MINFO, timeout)
    184172
    185     def lookupText(self, name, timeout = None):
     173    def lookupText(self, name, timeout=None):
    186174        """
    187         @see: twisted.names.client.lookupText
     175        @see: twisted.internet.interfaces.IResolver.lookupText
    188176        """
    189177        return self._lookup(name, dns.IN, dns.TXT, timeout)
    190178
    191     def lookupSenderPolicy(self, name, timeout = None):
     179    def lookupSenderPolicy(self, name, timeout=None):
    192180        """
    193         @see: twisted.names.client.lookupSenderPolicy
     181        @see: twisted.internet.interfaces.IResolver.lookupSenderPolicy
    194182        """
    195183        return self._lookup(name, dns.IN, dns.SPF, timeout)
    196184
    197     def lookupResponsibility(self, name, timeout = None):
     185    def lookupResponsibility(self, name, timeout=None):
    198186        """
    199         @see: twisted.names.client.lookupResponsibility
     187        @see: twisted.internet.interfaces.IResolver.lookupResponsibility
    200188        """
    201189        return self._lookup(name, dns.IN, dns.RP, timeout)
    202190
    203     def lookupAFSDatabase(self, name, timeout = None):
     191    def lookupAFSDatabase(self, name, timeout=None):
    204192        """
    205         @see: twisted.names.client.lookupAFSDatabase
     193        @see: twisted.internet.interfaces.IResolver.lookupAFSDatabase
    206194        """
    207195        return self._lookup(name, dns.IN, dns.AFSDB, timeout)
    208196
    209     def lookupZone(self, name, timeout = None):
     197    def lookupZone(self, name, timeout=None):
    210198        """
    211         @see: twisted.names.client.lookupZone
     199        @see: twisted.internet.interfaces.IResolver.lookupZone
    212200        """
    213201        return self._lookup(name, dns.IN, dns.AXFR, timeout)
    214202
    215203
    216204    def lookupNamingAuthorityPointer(self, name, timeout=None):
    217205        """
    218         @see: twisted.names.client.lookupNamingAuthorityPointer
     206        @see: twisted.internet.interfaces.IResolve.lookupNamingAuthorityPointer
    219207        """
    220208        return self._lookup(name, dns.IN, dns.NAPTR, timeout)
    221209
    222210
    223     def lookupAllRecords(self, name, timeout = None):
     211    def lookupAllRecords(self, name, timeout=None):
    224212        """
    225         @see: twisted.names.client.lookupAllRecords
     213        @see: twisted.internet.interfaces.IResolver.lookupAllRecords
    226214        """
    227215        return self._lookup(name, dns.IN, dns.ALL_RECORDS, timeout)
    228216