From: Petr Spacek Date: Thu, 15 Jan 2015 16:27:27 +0000 (+0100) Subject: Amend doc strings for all DNSExceptions to make them suitable for direct printing. X-Git-Tag: v1.13.0~35^2~5 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=90e85fa5196159a12f005d0e3383e893283a707c;p=thirdparty%2Fdnspython.git Amend doc strings for all DNSExceptions to make them suitable for direct printing. --- diff --git a/dns/dnssec.py b/dns/dnssec.py index f1d70cea..20925254 100644 --- a/dns/dnssec.py +++ b/dns/dnssec.py @@ -29,7 +29,7 @@ import dns.rdatatype import dns.rdataclass class UnsupportedAlgorithm(dns.exception.DNSException): - """Raised if an algorithm is not supported.""" + """The DNSSEC algorithm is not supported.""" pass class ValidationFailure(dns.exception.DNSException): diff --git a/dns/exception.py b/dns/exception.py index 575cebe8..e07b099d 100644 --- a/dns/exception.py +++ b/dns/exception.py @@ -33,13 +33,13 @@ class SyntaxError(DNSException): pass class UnexpectedEnd(SyntaxError): - """Raised if text input ends unexpectedly.""" + """Text input ended unexpectedly.""" pass class TooBig(DNSException): - """The message is too big.""" + """The DNS message is too big.""" pass class Timeout(DNSException): - """The operation timed out.""" + """The DNS operation timed out.""" pass diff --git a/dns/message.py b/dns/message.py index e5239314..ba714bda 100644 --- a/dns/message.py +++ b/dns/message.py @@ -37,31 +37,30 @@ import dns.tsig import dns.wiredata class ShortHeader(dns.exception.FormError): - """Raised if the DNS packet passed to from_wire() is too short.""" + """The DNS packet passed to from_wire() is too short.""" pass class TrailingJunk(dns.exception.FormError): - """Raised if the DNS packet passed to from_wire() has extra junk - at the end of it.""" + """The DNS packet passed to from_wire() has extra junk at the end of it.""" pass class UnknownHeaderField(dns.exception.DNSException): - """Raised if a header field name is not recognized when converting from - text into a message.""" + """The header field name was not recognized when converting from text + into a message.""" pass class BadEDNS(dns.exception.FormError): - """Raised if an OPT record occurs somewhere other than the start of + """OPT record occured somewhere other than the start of the additional data section.""" pass class BadTSIG(dns.exception.FormError): - """Raised if a TSIG record occurs somewhere other than the end of + """A TSIG record occured somewhere other than the end of the additional data section.""" pass class UnknownTSIGKey(dns.exception.DNSException): - """Raised if we got a TSIG but don't know the key.""" + """A TSIG with an unknown key was received.""" pass class Message(object): diff --git a/dns/name.py b/dns/name.py index 5eb925d6..f70a9a53 100644 --- a/dns/name.py +++ b/dns/name.py @@ -39,41 +39,41 @@ NAMERELN_EQUAL = 3 NAMERELN_COMMONANCESTOR = 4 class EmptyLabel(dns.exception.SyntaxError): - """Raised if a label is empty.""" + """A DNS label is empty.""" pass class BadEscape(dns.exception.SyntaxError): - """Raised if an escaped code in a text format name is invalid.""" + """An escaped code in a text format of DNS name is invalid.""" pass class BadPointer(dns.exception.FormError): - """Raised if a compression pointer points forward instead of backward.""" + """A DNS compression pointer points forward instead of backward.""" pass class BadLabelType(dns.exception.FormError): - """Raised if the label type of a wire format name is unknown.""" + """The label type in DNS name wire format is unknown.""" pass class NeedAbsoluteNameOrOrigin(dns.exception.DNSException): - """Raised if an attempt is made to convert a non-absolute name to - wire when there is also a non-absolute (or missing) origin.""" + """An attempt was made to convert a non-absolute name to + wire when there was also a non-absolute (or missing) origin.""" pass class NameTooLong(dns.exception.FormError): - """Raised if a name is > 255 octets long.""" + """A DNS name is > 255 octets long.""" pass class LabelTooLong(dns.exception.SyntaxError): - """Raised if a label is > 63 octets long.""" + """A DNS label is > 63 octets long.""" pass class AbsoluteConcatenation(dns.exception.DNSException): - """Raised if an attempt is made to append anything other than the - empty name to an absolute name.""" + """An attempt was made to append anything other than the + empty name to an absolute DNS name.""" pass class NoParent(dns.exception.DNSException): - """Raised if an attempt is made to get the parent of the root name + """An attempt was made to get the parent of the root name or the empty name.""" pass diff --git a/dns/opcode.py b/dns/opcode.py index 3258c34c..5a68517d 100644 --- a/dns/opcode.py +++ b/dns/opcode.py @@ -39,7 +39,7 @@ _by_value = dict([(y, x) for x, y in _by_text.iteritems()]) class UnknownOpcode(dns.exception.DNSException): - """Raised if an opcode is unknown.""" + """An DNS opcode is unknown.""" pass def from_text(text): diff --git a/dns/query.py b/dns/query.py index 29965cac..6eaf62d1 100644 --- a/dns/query.py +++ b/dns/query.py @@ -32,11 +32,11 @@ import dns.rdataclass import dns.rdatatype class UnexpectedSource(dns.exception.DNSException): - """Raised if a query response comes from an unexpected address or port.""" + """A DNS query response came from an unexpected address or port.""" pass class BadResponse(dns.exception.FormError): - """Raised if a query response does not respond to the question asked.""" + """A DNS query response does not respond to the question asked.""" pass def _compute_expiration(timeout): diff --git a/dns/rcode.py b/dns/rcode.py index 7807782a..cd43ab5e 100644 --- a/dns/rcode.py +++ b/dns/rcode.py @@ -53,7 +53,7 @@ _by_value = dict([(y, x) for x, y in _by_text.iteritems()]) class UnknownRcode(dns.exception.DNSException): - """Raised if an rcode is unknown.""" + """A DNS rcode is unknown.""" pass def from_text(text): diff --git a/dns/rdataclass.py b/dns/rdataclass.py index 7601e70c..96815836 100644 --- a/dns/rdataclass.py +++ b/dns/rdataclass.py @@ -66,7 +66,7 @@ _metaclasses = { _unknown_class_pattern = re.compile('CLASS([0-9]+)$', re.I); class UnknownRdataclass(dns.exception.DNSException): - """Raised when a class is unknown.""" + """A DNS class is unknown.""" pass def from_text(text): diff --git a/dns/rdataset.py b/dns/rdataset.py index dcd2b401..389205ce 100644 --- a/dns/rdataset.py +++ b/dns/rdataset.py @@ -29,12 +29,12 @@ import dns.set SimpleSet = dns.set.Set class DifferingCovers(dns.exception.DNSException): - """Raised if an attempt is made to add a SIG/RRSIG whose covered type + """An attempt was made to add a DNS SIG/RRSIG whose covered type is not the same as that of the other rdatas in the rdataset.""" pass class IncompatibleTypes(dns.exception.DNSException): - """Raised if an attempt is made to add rdata of an incompatible type.""" + """An attempt was made to add DNS RR data of an incompatible type.""" pass class Rdataset(dns.set.Set): diff --git a/dns/rdatatype.py b/dns/rdatatype.py index 7c21f2ec..5d914ae7 100644 --- a/dns/rdatatype.py +++ b/dns/rdatatype.py @@ -180,7 +180,7 @@ _singletons = { _unknown_type_pattern = re.compile('TYPE([0-9]+)$', re.I); class UnknownRdatatype(dns.exception.DNSException): - """Raised if a type is unknown.""" + """DNS resource record type is unknown.""" pass def from_text(text): diff --git a/dns/rdtypes/ANY/RRSIG.py b/dns/rdtypes/ANY/RRSIG.py index 77ce2bfd..5c16052c 100644 --- a/dns/rdtypes/ANY/RRSIG.py +++ b/dns/rdtypes/ANY/RRSIG.py @@ -23,7 +23,7 @@ import dns.rdata import dns.rdatatype class BadSigTime(dns.exception.DNSException): - """Raised when a SIG or RRSIG RR's time cannot be parsed.""" + """Time in DNS SIG or RRSIG resource record cannot be parsed.""" pass def sigtime_to_posixtime(what): diff --git a/dns/resolver.py b/dns/resolver.py index f52b5556..79de3ab4 100644 --- a/dns/resolver.py +++ b/dns/resolver.py @@ -44,11 +44,11 @@ if sys.platform == 'win32': import _winreg class NXDOMAIN(dns.exception.DNSException): - """The query name does not exist.""" + """The DNS query name does not exist.""" pass class YXDOMAIN(dns.exception.DNSException): - """The query name is too long after DNAME substitution.""" + """The DNS query name is too long after DNAME substitution.""" pass # The definition of the Timeout exception has moved from here to the @@ -66,19 +66,15 @@ class NoNameservers(dns.exception.DNSException): pass class NotAbsolute(dns.exception.DNSException): - """Raised if an absolute domain name is required but a relative name - was provided.""" + """An absolute domain name is required but a relative name was provided.""" pass class NoRootSOA(dns.exception.DNSException): - """Raised if for some reason there is no SOA at the root name. - This should never happen!""" + """There is no SOA RR at the DNS root name. This should never happen!""" pass class NoMetaqueries(dns.exception.DNSException): - """Metaqueries are not allowed.""" - pass - + """DNS metaqueries are not allowed.""" class Answer(object): """DNS stub resolver answer diff --git a/dns/tokenizer.py b/dns/tokenizer.py index ab568731..96e82df8 100644 --- a/dns/tokenizer.py +++ b/dns/tokenizer.py @@ -42,8 +42,7 @@ COMMENT = 5 DELIMITER = 6 class UngetBufferFull(dns.exception.DNSException): - """Raised when an attempt is made to unget a token when the unget - buffer is full.""" + """An attempt was made to unget a token when the unget buffer was full.""" pass class Token(object): diff --git a/dns/tsig.py b/dns/tsig.py index 2dd4b42f..01ab5a2f 100644 --- a/dns/tsig.py +++ b/dns/tsig.py @@ -25,11 +25,11 @@ import dns.rdataclass import dns.name class BadTime(dns.exception.DNSException): - """Raised if the current time is not within the TSIG's validity time.""" + """The current time is not within the TSIG's validity time.""" pass class BadSignature(dns.exception.DNSException): - """Raised if the TSIG signature fails to verify.""" + """The TSIG signature fails to verify.""" pass class PeerError(dns.exception.DNSException): @@ -37,19 +37,19 @@ class PeerError(dns.exception.DNSException): pass class PeerBadKey(PeerError): - """Raised if the peer didn't know the key we used""" + """The peer didn't know the key we used""" pass class PeerBadSignature(PeerError): - """Raised if the peer didn't like the signature we sent""" + """The peer didn't like the signature we sent""" pass class PeerBadTime(PeerError): - """Raised if the peer didn't like the time we sent""" + """The peer didn't like the time we sent""" pass class PeerBadTruncation(PeerError): - """Raised if the peer didn't like amount of truncation in the TSIG we sent""" + """The peer didn't like amount of truncation in the TSIG we sent""" pass # TSIG Algorithms diff --git a/dns/zone.py b/dns/zone.py index 6f5adf57..b7fc6dd3 100644 --- a/dns/zone.py +++ b/dns/zone.py @@ -37,19 +37,19 @@ except ImportError: from io import StringIO class BadZone(dns.exception.DNSException): - """The zone is malformed.""" + """The DNS zone is malformed.""" pass class NoSOA(BadZone): - """The zone has no SOA RR at its origin.""" + """The DNS zone has no SOA RR at its origin.""" pass class NoNS(BadZone): - """The zone has no NS RRset at its origin.""" + """The DNS zone has no NS RRset at its origin.""" pass class UnknownOrigin(BadZone): - """The zone's origin is unknown.""" + """The DNS zone's origin is unknown.""" pass class Zone(object):