diff options
| author | Petr Spacek <pspacek@redhat.com> | 2015-01-15 17:27:27 +0100 |
|---|---|---|
| committer | Petr Spacek <pspacek@redhat.com> | 2015-02-12 12:38:31 +0100 |
| commit | c34f16726386fecd62507b8c1bfa23770c18e3ec (patch) | |
| tree | 23230c4ab1f4d2d965a39612f2ff154f551f505c | |
| parent | 6631d8e37fcb57aac45852ef311007139a8e4221 (diff) | |
| download | dnspython-c34f16726386fecd62507b8c1bfa23770c18e3ec.tar.gz | |
Amend doc strings for all DNSExceptions to make them suitable for direct printing.
| -rw-r--r-- | dns/dnssec.py | 2 | ||||
| -rw-r--r-- | dns/exception.py | 6 | ||||
| -rw-r--r-- | dns/message.py | 15 | ||||
| -rw-r--r-- | dns/name.py | 22 | ||||
| -rw-r--r-- | dns/opcode.py | 2 | ||||
| -rw-r--r-- | dns/query.py | 4 | ||||
| -rw-r--r-- | dns/rcode.py | 2 | ||||
| -rw-r--r-- | dns/rdataclass.py | 2 | ||||
| -rw-r--r-- | dns/rdataset.py | 4 | ||||
| -rw-r--r-- | dns/rdatatype.py | 2 | ||||
| -rw-r--r-- | dns/rdtypes/ANY/RRSIG.py | 2 | ||||
| -rw-r--r-- | dns/resolver.py | 13 | ||||
| -rw-r--r-- | dns/tokenizer.py | 3 | ||||
| -rw-r--r-- | dns/tsig.py | 12 | ||||
| -rw-r--r-- | dns/zone.py | 8 |
15 files changed, 47 insertions, 52 deletions
diff --git a/dns/dnssec.py b/dns/dnssec.py index 2dd4a67..52f9ba6 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 575cebe..e07b099 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 869a247..d672a3a 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 daa5261..8ffa674 100644 --- a/dns/name.py +++ b/dns/name.py @@ -38,41 +38,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 a12d82b..52e0ce6 100644 --- a/dns/opcode.py +++ b/dns/opcode.py @@ -39,7 +39,7 @@ _by_value = dict([(y, x) for x, y in _by_text.items()]) 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 2a252c7..8b0a227 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 fb9c30c..8b9f8bd 100644 --- a/dns/rcode.py +++ b/dns/rcode.py @@ -53,7 +53,7 @@ _by_value = dict([(y, x) for x, y in _by_text.items()]) 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 eda701a..c5845a0 100644 --- a/dns/rdataclass.py +++ b/dns/rdataclass.py @@ -63,7 +63,7 @@ _metaclasses = frozenset([NONE, ANY]) _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 e7fea8d..7a9cc37 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 d5d9f7c..f2f5e98 100644 --- a/dns/rdatatype.py +++ b/dns/rdatatype.py @@ -172,7 +172,7 @@ _singletons = frozenset([SOA, NXT, DNAME, NSEC, NSEC3, NSEC3PARAM]) _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 6f39cb8..e9b625b 100644 --- a/dns/rdtypes/ANY/RRSIG.py +++ b/dns/rdtypes/ANY/RRSIG.py @@ -25,7 +25,7 @@ import dns.rdatatype import dns.util 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 3d3cccb..d59f413 100644 --- a/dns/resolver.py +++ b/dns/resolver.py @@ -47,11 +47,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 @@ -69,18 +69,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 adac5e2..c214510 100644 --- a/dns/tokenizer.py +++ b/dns/tokenizer.py @@ -34,8 +34,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 4333016..3de11c9 100644 --- a/dns/tsig.py +++ b/dns/tsig.py @@ -26,11 +26,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): @@ -38,19 +38,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 ece898a..b127764 100644 --- a/dns/zone.py +++ b/dns/zone.py @@ -34,19 +34,19 @@ import dns.ttl import dns.grange 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): |
