home *** CD-ROM | disk | FTP | other *** search
- # Source Generated with Decompyle++
- # File: in.pyc (Python 2.6)
-
- import dns.exception as dns
-
- class DHCID(dns.rdata.Rdata):
- __slots__ = [
- 'data']
-
- def __init__(self, rdclass, rdtype, data):
- super(DHCID, self).__init__(rdclass, rdtype)
- self.data = data
-
-
- def to_text(self, origin = None, relativize = True, **kw):
- return dns.rdata._base64ify(self.data)
-
-
- def from_text(cls, rdclass, rdtype, tok, origin = None, relativize = True):
- chunks = []
- while None:
- t = tok.get()
- if t[0] == dns.tokenizer.EOL or t[0] == dns.tokenizer.EOF:
- break
-
- if t[0] != dns.tokenizer.IDENTIFIER:
- raise dns.exception.SyntaxError
- chunks.append(t[1])
- continue
- b64 = ''.join(chunks)
- data = b64.decode('base64_codec')
- return cls(rdclass, rdtype, data)
-
- from_text = classmethod(from_text)
-
- def to_wire(self, file, compress = None, origin = None):
- file.write(self.data)
-
-
- def from_wire(cls, rdclass, rdtype, wire, current, rdlen, origin = None):
- data = wire[current:current + rdlen]
- return cls(rdclass, rdtype, data)
-
- from_wire = classmethod(from_wire)
-
- def _cmp(self, other):
- return cmp(self.data, other.data)
-
-
-