summaryrefslogtreecommitdiff
path: root/dns/rdtypes/ANY/RP.py
diff options
context:
space:
mode:
authorBob Halley <halley@nominum.com>2009-06-19 11:57:39 +0100
committerBob Halley <halley@nominum.com>2009-06-19 11:57:39 +0100
commitf6a2d3d27d0e093458a4f1eeff63f2493cd60a97 (patch)
tree0866a7ace589fafa0dcf71e7c22981ce55d1a2f7 /dns/rdtypes/ANY/RP.py
parent066101a9d9e27d01c23850fff4720906322aa9ab (diff)
downloaddnspython-f6a2d3d27d0e093458a4f1eeff63f2493cd60a97.tar.gz
Add to_digestable() methods to rdata classes
Diffstat (limited to 'dns/rdtypes/ANY/RP.py')
-rw-r--r--dns/rdtypes/ANY/RP.py12
1 files changed, 8 insertions, 4 deletions
diff --git a/dns/rdtypes/ANY/RP.py b/dns/rdtypes/ANY/RP.py
index c48515d..2029bff 100644
--- a/dns/rdtypes/ANY/RP.py
+++ b/dns/rdtypes/ANY/RP.py
@@ -28,7 +28,7 @@ class RP(dns.rdata.Rdata):
@see: RFC 1183"""
__slots__ = ['mbox', 'txt']
-
+
def __init__(self, rdclass, rdtype, mbox, txt):
super(RP, self).__init__(rdclass, rdtype)
self.mbox = mbox
@@ -38,7 +38,7 @@ class RP(dns.rdata.Rdata):
mbox = self.mbox.choose_relativity(origin, relativize)
txt = self.txt.choose_relativity(origin, relativize)
return "%s %s" % (str(mbox), str(txt))
-
+
def from_text(cls, rdclass, rdtype, tok, origin = None, relativize = True):
mbox = tok.get_name()
txt = tok.get_name()
@@ -46,13 +46,17 @@ class RP(dns.rdata.Rdata):
txt = txt.choose_relativity(origin, relativize)
tok.get_eol()
return cls(rdclass, rdtype, mbox, txt)
-
+
from_text = classmethod(from_text)
def to_wire(self, file, compress = None, origin = None):
self.mbox.to_wire(file, None, origin)
self.txt.to_wire(file, None, origin)
-
+
+ def to_digestable(self, origin = None):
+ return self.mbox.to_digestable(origin) + \
+ self.txt.to_digestable(origin)
+
def from_wire(cls, rdclass, rdtype, wire, current, rdlen, origin = None):
(mbox, cused) = dns.name.from_wire(wire[: current + rdlen],
current)