]> git.ipfire.org Git - thirdparty/dnspython.git/commitdiff
doco fixes
authorBob Halley <halley@nominum.com>
Sun, 8 Apr 2012 13:22:51 +0000 (14:22 +0100)
committerBob Halley <halley@nominum.com>
Sun, 8 Apr 2012 13:22:51 +0000 (14:22 +0100)
dns/e164.py
dns/edns.py
dns/ipv4.py
dns/ipv6.py
dns/query.py
dns/resolver.py
dns/tokenizer.py

index cbb1338805627f6c449f41f18db1059f61a45360..3a14fd1d6ddafa5d9a3746f06245bf40585eb501 100644 (file)
@@ -32,7 +32,7 @@ def from_e164(text, origin=public_enum_domain):
     @type text: str
     @param origin: The domain in which the number should be constructed.
     The default is e164.arpa.
-    @type: dns.name.Name object or None
+    @type origin: dns.name.Name object or None
     @rtype: dns.name.Name object
     """
     parts = [d for d in text if d.isdigit()]
@@ -45,7 +45,7 @@ def to_e164(name, origin=public_enum_domain, want_plus_prefix=True):
     @type name: dns.name.Name object.
     @param origin: A domain containing the ENUM domain name.  The
     name is relativized to this domain before being converted to text.
-    @type: dns.name.Name object or None
+    @type origin: dns.name.Name object or None
     @param want_plus_prefix: if True, add a '+' to the beginning of the
     returned number.
     @rtype: str
index ef52776e802ae7ea4f4617d2ece80b82d7bdc6ae..f0e1c53d64b96e17b501967dfe46713c681311c6 100644 (file)
@@ -23,8 +23,8 @@ class Option(object):
 
     def __init__(self, otype):
         """Initialize an option.
-        @param rdtype: The rdata type
-        @type rdtype: int
+        @param otype: The rdata type
+        @type otype: int
         """
         self.otype = otype
 
index f3b6c5c550a71ad8691355934bae32ddb044d273..d2f77037e3b1705fceb4ab842b5e4f73070d7cf4 100644 (file)
@@ -20,11 +20,23 @@ import struct
 import dns.exception
 
 def inet_ntoa(address):
+    """Convert an IPv4 address in network form to text form.
+
+    @param address: The IPv4 address
+    @type address: bytes
+    @returns: string
+    """
     if len(address) != 4:
         raise dns.exception.SyntaxError
     return '%u.%u.%u.%u' % (address[0], address[1], address[2], address[3])
 
 def inet_aton(text):
+    """Convert an IPv4 address in text form to network form.
+
+    @param text: The IPv4 address
+    @type text: string
+    @returns: bytes
+    """
     parts = text.split('.')
     if len(parts) != 4:
         raise dns.exception.SyntaxError
index e2bcecd111210e6d824725ae3cc9f0fb9ea074b4..17d43a398010cde9343d60c473671c1c29191798 100644 (file)
@@ -25,7 +25,7 @@ def inet_ntoa(address):
     """Convert a network format IPv6 address into text.
 
     @param address: the binary address
-    @type address: string
+    @type address: bytes
     @rtype: string
     @raises ValueError: the address isn't 16 bytes long
     """
@@ -93,7 +93,7 @@ def inet_aton(text):
 
     @param text: the textual address
     @type text: string
-    @rtype: string
+    @rtype: bytes
     @raises dns.exception.SyntaxError: the text was not properly formatted
     """
 
index 0e6eb9293cf53ea36f73286eee9b83ec94fb6dc4..2148df0fd187846ff659d8b71aff1eb14618770b 100644 (file)
@@ -46,12 +46,15 @@ def _compute_expiration(timeout):
         return time.time() + timeout
 
 def _poll_for(fd, readable, writable, error, timeout):
-    """
-    @param fd: File descriptor (int).
-    @param readable: Whether to wait for readability (bool).
-    @param writable: Whether to wait for writability (bool).
-    @param expiration: Deadline timeout (expiration time, in seconds (float)).
-
+    """Poll polling backend.
+    @param fd: File descriptor
+    @type fd: int
+    @param readable: Whether to wait for readability
+    @type readable: bool
+    @param writable: Whether to wait for writability
+    @type writable: bool
+    @param timeout: Deadline timeout (expiration time, in seconds)
+    @type timeout: float
     @return True on success, False on timeout
     """
     event_mask = 0
@@ -73,12 +76,15 @@ def _poll_for(fd, readable, writable, error, timeout):
     return bool(event_list)
 
 def _select_for(fd, readable, writable, error, timeout):
-    """
-    @param fd: File descriptor (int).
-    @param readable: Whether to wait for readability (bool).
-    @param writable: Whether to wait for writability (bool).
-    @param expiration: Deadline timeout (expiration time, in seconds (float)).
-
+    """Select polling backend.
+    @param fd: File descriptor
+    @type fd: int
+    @param readable: Whether to wait for readability
+    @type readable: bool
+    @param writable: Whether to wait for writability
+    @type writable: bool
+    @param timeout: Deadline timeout (expiration time, in seconds)
+    @type timeout: float
     @return True on success, False on timeout
     """
     rset, wset, xset = [], [], []
index 4fb13d369be6d139685bb69f7056599a10890416..d2c7a6a0de387e4a265babe7b83f0b6308060eea 100644 (file)
@@ -315,8 +315,7 @@ class LRUCache(object):
     def __init__(self, max_size=100000):
         """Initialize a DNS cache.
 
-        @param max_size: The maximum number of nodes to cache; the default is
-        100000.  Must be > 1.
+        @param max_size: The maximum number of nodes to cache; the default is 100000.  Must be > 1.
         @type max_size: int
         """
         self.data = {}
index 77636a23d9e1ceb7a4dc011fc6a4e777575dcc11..adac5e290ec9c951fef68e292d699ff76fb86be4 100644 (file)
@@ -54,9 +54,9 @@ class Token(object):
 
         @param ttype: The token type
         @type ttype: int
-        @ivar value: The token value
+        @param value: The token value
         @type value: string
-        @ivar has_escape: Does the token value contain escapes?
+        @param has_escape: Does the token value contain escapes?
         @type has_escape: bool
         """
         self.ttype = ttype