!`Nc@szdZddlZddlZddlZddlZdejjfdYZdZ dZ dZ dZ dS( s)DNS RRsets (an RRset is a named rdataset)iNtRRsetcBseZdZddgZejjd dZdZ dZ dZ dZ d dZ d ed Zd d d Zd ZRS( s6A DNS RRset (named rdataset). RRset inherits from Rdataset, and RRsets can be treated as Rdatasets in most cases. There are, however, a few notable exceptions. RRsets have different to_wire() and to_text() method arguments, reflecting the fact that RRsets always have an owner name. tnametdeletingcCs2tt|j|||||_||_dS(sCreate a new RRset.N(tsuperRt__init__RR(tselfRtrdclasstrdtypetcoversR((s//usr/lib64/python2.7/site-packages/dns/rrset.pyR#s cCs1tt|j}|j|_|j|_|S(N(RRt_cloneRR(Rtobj((s//usr/lib64/python2.7/site-packages/dns/rrset.pyR +s  cCs|jdkrd}ndtjj|jd}|jdk r`dtjj|j}nd}dt|jdtjj|j dtjj|j ||dS( Nitt(t)s delete=s( Rtdnst rdatatypetto_textRtNonet rdataclasststrRRR(Rtctexttdtext((s//usr/lib64/python2.7/site-packages/dns/rrset.pyt__repr__1s cCs |jS(N(R(R((s//usr/lib64/python2.7/site-packages/dns/rrset.pyt__str__>scCs?t|tstS|j|jkr)tStt|j|S(scTwo RRsets are equal if they have the same name and the same rdataset @rtype: bool(t isinstanceRtFalseRRt__eq__(Rtother((s//usr/lib64/python2.7/site-packages/dns/rrset.pyRAs cCsHtt|j|||s"tS|j|ks@|j|krDtStS(saReturns True if this rrset matches the specified class, type, covers, and deletion state.(RRtmatchRRRtTrue(RRRRRR((s//usr/lib64/python2.7/site-packages/dns/rrset.pyRLs cKs(tt|j|j|||j|S(sConvert the RRset into DNS master file format. @see: L{dns.name.Name.choose_relativity} for more information on how I{origin} and I{relativize} determine the way names are emitted. Any additional keyword arguments are passed on to the rdata to_text() method. @param origin: The origin for relative names, or None. @type origin: dns.name.Name object @param relativize: True if names should names be relativized @type relativize: bool(RRRRR(Rtorigint relativizetkw((s//usr/lib64/python2.7/site-packages/dns/rrset.pyRVscKs+tt|j|j||||j|S(s!Convert the RRset to wire format.(RRtto_wireRR(RtfiletcompressRR!((s//usr/lib64/python2.7/site-packages/dns/rrset.pyR"hscCstjj|jt|S(sYConvert an RRset into an Rdataset. @rtype: dns.rdataset.Rdataset object (Rtrdatasettfrom_rdata_listtttltlist(R((s//usr/lib64/python2.7/site-packages/dns/rrset.pyt to_rdatasetnsN(t__name__t __module__t__doc__t __slots__RRtNONERRR RRRRRRR"R)(((s//usr/lib64/python2.7/site-packages/dns/rrset.pyRs      cCst|ttfr-tjj|d}nt|ttfrWtjj|}nt|ttfrtjj|}nt |||}|j |x9|D]1}tj j|j |j |}|j|qW|S(sCreate an RRset with the specified name, TTL, class, and type, and with the specified list of rdatas in text format. @rtype: dns.rrset.RRset object N(RRtunicodeRRt from_textRRRRt update_ttltrdataRRtadd(RR'RRt text_rdatastrtttrd((s//usr/lib64/python2.7/site-packages/dns/rrset.pytfrom_text_listvs  cGst|||||S(sCreate an RRset with the specified name, TTL, class, and type and with the specified rdatas in text format. @rtype: dns.rrset.RRset object (R8(RR'RRR4((s//usr/lib64/python2.7/site-packages/dns/rrset.pyR0scCst|ttfr-tjj|d}nt|dkrNtdnd}xU|D]M}|dkrt ||j |j }|j |t }n|j|q[W|S(sCreate an RRset with the specified name and TTL, and with the specified list of rdata objects. @rtype: dns.rrset.RRset object isrdata list must not be emptyN(RRR/RRR0Rtlent ValueErrorRRRR1RR3(RR'trdatasR5R7t first_time((s//usr/lib64/python2.7/site-packages/dns/rrset.pyR&s    cGst|||S(sCreate an RRset with the specified name and TTL, and with the specified rdata objects. @rtype: dns.rrset.RRset object (R&(RR'R;((s//usr/lib64/python2.7/site-packages/dns/rrset.pyt from_rdatas( R,tdns.nameRt dns.rdatasettdns.rdataclasst dns.rendererR%tRdatasetRR8R0R&R=(((s//usr/lib64/python2.7/site-packages/dns/rrset.pyts    _