home *** CD-ROM | disk | FTP | other *** search
- # Source Generated with Decompyle++
- # File: in.pyc (Python 2.6)
-
- import dns.exception as dns
- import dns.ipv4 as dns
- import dns.rdata as dns
- import dns.tokenizer as dns
-
- class A(dns.rdata.Rdata):
- __slots__ = [
- 'address']
-
- def __init__(self, rdclass, rdtype, address):
- super(A, self).__init__(rdclass, rdtype)
- junk = dns.ipv4.inet_aton(address)
- self.address = address
-
-
- def to_text(self, origin = None, relativize = True, **kw):
- return self.address
-
-
- def from_text(cls, rdclass, rdtype, tok, origin = None, relativize = True):
- (ttype, address) = tok.get()
- if ttype != dns.tokenizer.IDENTIFIER:
- raise dns.exception.SyntaxError
- ttype != dns.tokenizer.IDENTIFIER
- t = tok.get_eol()
- return cls(rdclass, rdtype, address)
-
- from_text = classmethod(from_text)
-
- def to_wire(self, file, compress = None, origin = None):
- file.write(dns.ipv4.inet_aton(self.address))
-
-
- def from_wire(cls, rdclass, rdtype, wire, current, rdlen, origin = None):
- address = dns.ipv4.inet_ntoa(wire[current:current + rdlen])
- return cls(rdclass, rdtype, address)
-
- from_wire = classmethod(from_wire)
-
- def _cmp(self, other):
- sa = dns.ipv4.inet_aton(self.address)
- oa = dns.ipv4.inet_aton(other.address)
- return cmp(sa, oa)
-
-
-