summaryrefslogtreecommitdiff
path: root/lib/dnspython/dns/rdtypes
diff options
context:
space:
mode:
Diffstat (limited to 'lib/dnspython/dns/rdtypes')
-rw-r--r--lib/dnspython/dns/rdtypes/ANY/GPOS.py10
-rw-r--r--lib/dnspython/dns/rdtypes/ANY/HINFO.py8
-rw-r--r--lib/dnspython/dns/rdtypes/ANY/SOA.py6
-rw-r--r--lib/dnspython/dns/rdtypes/ANY/SSHFP.py8
-rw-r--r--lib/dnspython/dns/rdtypes/ANY/X25.py8
-rw-r--r--lib/dnspython/dns/rdtypes/IN/NAPTR.py8
-rw-r--r--lib/dnspython/dns/rdtypes/IN/PX.py8
7 files changed, 28 insertions, 28 deletions
diff --git a/lib/dnspython/dns/rdtypes/ANY/GPOS.py b/lib/dnspython/dns/rdtypes/ANY/GPOS.py
index aa8000f8ca..6f63cc05f6 100644
--- a/lib/dnspython/dns/rdtypes/ANY/GPOS.py
+++ b/lib/dnspython/dns/rdtypes/ANY/GPOS.py
@@ -29,7 +29,7 @@ def _validate_float_string(what):
raise dns.exception.FormError
if not right == '' and not right.isdigit():
raise dns.exception.FormError
-
+
class GPOS(dns.rdata.Rdata):
"""GPOS record
@@ -42,7 +42,7 @@ class GPOS(dns.rdata.Rdata):
@see: RFC 1712"""
__slots__ = ['latitude', 'longitude', 'altitude']
-
+
def __init__(self, rdclass, rdtype, latitude, longitude, altitude):
super(GPOS, self).__init__(rdclass, rdtype)
if isinstance(latitude, float) or \
@@ -66,14 +66,14 @@ class GPOS(dns.rdata.Rdata):
def to_text(self, origin=None, relativize=True, **kw):
return '%s %s %s' % (self.latitude, self.longitude, self.altitude)
-
+
def from_text(cls, rdclass, rdtype, tok, origin = None, relativize = True):
latitude = tok.get_string()
longitude = tok.get_string()
altitude = tok.get_string()
tok.get_eol()
return cls(rdclass, rdtype, latitude, longitude, altitude)
-
+
from_text = classmethod(from_text)
def to_wire(self, file, compress = None, origin = None):
@@ -92,7 +92,7 @@ class GPOS(dns.rdata.Rdata):
byte = chr(l)
file.write(byte)
file.write(self.altitude)
-
+
def from_wire(cls, rdclass, rdtype, wire, current, rdlen, origin = None):
l = ord(wire[current])
current += 1
diff --git a/lib/dnspython/dns/rdtypes/ANY/HINFO.py b/lib/dnspython/dns/rdtypes/ANY/HINFO.py
index 5cfef5a932..e592ad39a7 100644
--- a/lib/dnspython/dns/rdtypes/ANY/HINFO.py
+++ b/lib/dnspython/dns/rdtypes/ANY/HINFO.py
@@ -27,7 +27,7 @@ class HINFO(dns.rdata.Rdata):
@see: RFC 1035"""
__slots__ = ['cpu', 'os']
-
+
def __init__(self, rdclass, rdtype, cpu, os):
super(HINFO, self).__init__(rdclass, rdtype)
self.cpu = cpu
@@ -36,13 +36,13 @@ class HINFO(dns.rdata.Rdata):
def to_text(self, origin=None, relativize=True, **kw):
return '"%s" "%s"' % (dns.rdata._escapify(self.cpu),
dns.rdata._escapify(self.os))
-
+
def from_text(cls, rdclass, rdtype, tok, origin = None, relativize = True):
cpu = tok.get_string()
os = tok.get_string()
tok.get_eol()
return cls(rdclass, rdtype, cpu, os)
-
+
from_text = classmethod(from_text)
def to_wire(self, file, compress = None, origin = None):
@@ -56,7 +56,7 @@ class HINFO(dns.rdata.Rdata):
byte = chr(l)
file.write(byte)
file.write(self.os)
-
+
def from_wire(cls, rdclass, rdtype, wire, current, rdlen, origin = None):
l = ord(wire[current])
current += 1
diff --git a/lib/dnspython/dns/rdtypes/ANY/SOA.py b/lib/dnspython/dns/rdtypes/ANY/SOA.py
index 5f74b8d384..a25a35e29b 100644
--- a/lib/dnspython/dns/rdtypes/ANY/SOA.py
+++ b/lib/dnspython/dns/rdtypes/ANY/SOA.py
@@ -41,7 +41,7 @@ class SOA(dns.rdata.Rdata):
__slots__ = ['mname', 'rname', 'serial', 'refresh', 'retry', 'expire',
'minimum']
-
+
def __init__(self, rdclass, rdtype, mname, rname, serial, refresh, retry,
expire, minimum):
super(SOA, self).__init__(rdclass, rdtype)
@@ -59,7 +59,7 @@ class SOA(dns.rdata.Rdata):
return '%s %s %d %d %d %d %d' % (
mname, rname, self.serial, self.refresh, self.retry,
self.expire, self.minimum )
-
+
def from_text(cls, rdclass, rdtype, tok, origin = None, relativize = True):
mname = tok.get_name()
rname = tok.get_name()
@@ -73,7 +73,7 @@ class SOA(dns.rdata.Rdata):
tok.get_eol()
return cls(rdclass, rdtype, mname, rname, serial, refresh, retry,
expire, minimum )
-
+
from_text = classmethod(from_text)
def to_wire(self, file, compress = None, origin = None):
diff --git a/lib/dnspython/dns/rdtypes/ANY/SSHFP.py b/lib/dnspython/dns/rdtypes/ANY/SSHFP.py
index bc54f5e260..162dda5c48 100644
--- a/lib/dnspython/dns/rdtypes/ANY/SSHFP.py
+++ b/lib/dnspython/dns/rdtypes/ANY/SSHFP.py
@@ -30,7 +30,7 @@ class SSHFP(dns.rdata.Rdata):
@see: draft-ietf-secsh-dns-05.txt"""
__slots__ = ['algorithm', 'fp_type', 'fingerprint']
-
+
def __init__(self, rdclass, rdtype, algorithm, fp_type,
fingerprint):
super(SSHFP, self).__init__(rdclass, rdtype)
@@ -43,7 +43,7 @@ class SSHFP(dns.rdata.Rdata):
self.fp_type,
dns.rdata._hexify(self.fingerprint,
chunksize=128))
-
+
def from_text(cls, rdclass, rdtype, tok, origin = None, relativize = True):
algorithm = tok.get_uint8()
fp_type = tok.get_uint8()
@@ -51,14 +51,14 @@ class SSHFP(dns.rdata.Rdata):
fingerprint = fingerprint.decode('hex_codec')
tok.get_eol()
return cls(rdclass, rdtype, algorithm, fp_type, fingerprint)
-
+
from_text = classmethod(from_text)
def to_wire(self, file, compress = None, origin = None):
header = struct.pack("!BB", self.algorithm, self.fp_type)
file.write(header)
file.write(self.fingerprint)
-
+
def from_wire(cls, rdclass, rdtype, wire, current, rdlen, origin = None):
header = struct.unpack("!BB", wire[current : current + 2])
current += 2
diff --git a/lib/dnspython/dns/rdtypes/ANY/X25.py b/lib/dnspython/dns/rdtypes/ANY/X25.py
index fc4790fe8a..c3632f7fc4 100644
--- a/lib/dnspython/dns/rdtypes/ANY/X25.py
+++ b/lib/dnspython/dns/rdtypes/ANY/X25.py
@@ -25,19 +25,19 @@ class X25(dns.rdata.Rdata):
@see: RFC 1183"""
__slots__ = ['address']
-
+
def __init__(self, rdclass, rdtype, address):
super(X25, self).__init__(rdclass, rdtype)
self.address = address
def to_text(self, origin=None, relativize=True, **kw):
return '"%s"' % dns.rdata._escapify(self.address)
-
+
def from_text(cls, rdclass, rdtype, tok, origin = None, relativize = True):
address = tok.get_string()
tok.get_eol()
return cls(rdclass, rdtype, address)
-
+
from_text = classmethod(from_text)
def to_wire(self, file, compress = None, origin = None):
@@ -46,7 +46,7 @@ class X25(dns.rdata.Rdata):
byte = chr(l)
file.write(byte)
file.write(self.address)
-
+
def from_wire(cls, rdclass, rdtype, wire, current, rdlen, origin = None):
l = ord(wire[current])
current += 1
diff --git a/lib/dnspython/dns/rdtypes/IN/NAPTR.py b/lib/dnspython/dns/rdtypes/IN/NAPTR.py
index 3a30d16d7b..a3cca55e1c 100644
--- a/lib/dnspython/dns/rdtypes/IN/NAPTR.py
+++ b/lib/dnspython/dns/rdtypes/IN/NAPTR.py
@@ -45,7 +45,7 @@ class NAPTR(dns.rdata.Rdata):
__slots__ = ['order', 'preference', 'flags', 'service', 'regexp',
'replacement']
-
+
def __init__(self, rdclass, rdtype, order, preference, flags, service,
regexp, replacement):
super(NAPTR, self).__init__(rdclass, rdtype)
@@ -76,7 +76,7 @@ class NAPTR(dns.rdata.Rdata):
tok.get_eol()
return cls(rdclass, rdtype, order, preference, flags, service,
regexp, replacement)
-
+
from_text = classmethod(from_text)
def to_wire(self, file, compress = None, origin = None):
@@ -86,7 +86,7 @@ class NAPTR(dns.rdata.Rdata):
_write_string(file, self.service)
_write_string(file, self.regexp)
self.replacement.to_wire(file, compress, origin)
-
+
def from_wire(cls, rdclass, rdtype, wire, current, rdlen, origin = None):
(order, preference) = struct.unpack('!HH', wire[current : current + 4])
current += 4
@@ -116,7 +116,7 @@ class NAPTR(dns.rdata.Rdata):
def choose_relativity(self, origin = None, relativize = True):
self.replacement = self.replacement.choose_relativity(origin,
relativize)
-
+
def _cmp(self, other):
sp = struct.pack("!HH", self.order, self.preference)
op = struct.pack("!HH", other.order, other.preference)
diff --git a/lib/dnspython/dns/rdtypes/IN/PX.py b/lib/dnspython/dns/rdtypes/IN/PX.py
index 4718944ff4..0f11290724 100644
--- a/lib/dnspython/dns/rdtypes/IN/PX.py
+++ b/lib/dnspython/dns/rdtypes/IN/PX.py
@@ -31,7 +31,7 @@ class PX(dns.rdata.Rdata):
@see: RFC 2163"""
__slots__ = ['preference', 'map822', 'mapx400']
-
+
def __init__(self, rdclass, rdtype, preference, map822, mapx400):
super(PX, self).__init__(rdclass, rdtype)
self.preference = preference
@@ -42,7 +42,7 @@ class PX(dns.rdata.Rdata):
map822 = self.map822.choose_relativity(origin, relativize)
mapx400 = self.mapx400.choose_relativity(origin, relativize)
return '%d %s %s' % (self.preference, map822, mapx400)
-
+
def from_text(cls, rdclass, rdtype, tok, origin = None, relativize = True):
preference = tok.get_uint16()
map822 = tok.get_name()
@@ -51,7 +51,7 @@ class PX(dns.rdata.Rdata):
mapx400 = mapx400.choose_relativity(origin, relativize)
tok.get_eol()
return cls(rdclass, rdtype, preference, map822, mapx400)
-
+
from_text = classmethod(from_text)
def to_wire(self, file, compress = None, origin = None):
@@ -59,7 +59,7 @@ class PX(dns.rdata.Rdata):
file.write(pref)
self.map822.to_wire(file, None, origin)
self.mapx400.to_wire(file, None, origin)
-
+
def from_wire(cls, rdclass, rdtype, wire, current, rdlen, origin = None):
(preference, ) = struct.unpack('!H', wire[current : current + 2])
current += 2