Package dns :: Module rrset :: Class RRset
[hide private]
[frames] | no frames]

Class RRset

source code

   object --+        
            |        
      set.Set --+    
                |    
rdataset.Rdataset --+
                    |
                   RRset

A 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.

Instance Methods [hide private]
 
__init__(self, name, rdclass, rdtype, covers=0, deleting=None)
Create a new RRset.
source code
 
_clone(self)
Make a (shallow) copy of the set.
source code
 
__repr__(self)
repr(x)
source code
 
__str__(self)
str(x)
source code
bool
__eq__(self, other)
Two RRsets are equal if they have the same name and the same rdataset
source code
 
match(self, name, rdclass, rdtype, covers, deleting=None)
Returns True if this rrset matches the specified class, type, covers, and deletion state.
source code
 
to_text(self, origin=None, relativize=True, **kw)
Convert the RRset into DNS master file format.
source code
int
to_wire(self, file, compress=None, origin=None, **kw)
Convert the RRset to wire format.
source code
dns.rdataset.Rdataset object
to_rdataset(self)
Convert an RRset into an Rdataset.
source code

Inherited from rdataset.Rdataset: __ne__, add, intersection_update, union_update, update, update_ttl

Inherited from set.Set: __add__, __and__, __copy__, __delitem__, __getitem__, __iadd__, __iand__, __ior__, __isub__, __iter__, __len__, __or__, __sub__, clear, copy, difference, difference_update, discard, intersection, issubset, issuperset, remove, union

Inherited from object: __delattr__, __format__, __getattribute__, __hash__, __new__, __reduce__, __reduce_ex__, __setattr__, __sizeof__, __subclasshook__

Instance Variables [hide private]

Inherited from rdataset.Rdataset: covers, rdclass, rdtype, ttl

Inherited from set.Set: items

Properties [hide private]
  deleting
  name

Inherited from object: __class__

Method Details [hide private]

__init__(self, name, rdclass, rdtype, covers=0, deleting=None)
(Constructor)

source code 

Create a new RRset.

Parameters:
  • items - the initial set of items
Overrides: object.__init__

_clone(self)

source code 

Make a (shallow) copy of the set.

There is a 'clone protocol' that subclasses of this class should use. To make a copy, first call your super's _clone() method, and use the object returned as the new instance. Then make shallow copies of the attributes defined in the subclass.

This protocol allows us to write the set algorithms that return new instances (e.g. union) once, and keep using them in subclasses.

Overrides: set.Set._clone
(inherited documentation)

__repr__(self)
(Representation operator)

source code 

repr(x)

Overrides: object.__repr__
(inherited documentation)

__str__(self)
(Informal representation operator)

source code 

str(x)

Overrides: object.__str__
(inherited documentation)

__eq__(self, other)
(Equality operator)

source code 

Two RRsets are equal if they have the same name and the same rdataset

Returns: bool
Overrides: set.Set.__eq__

match(self, name, rdclass, rdtype, covers, deleting=None)

source code 

Returns True if this rrset matches the specified class, type, covers, and deletion state.

Overrides: rdataset.Rdataset.match

to_text(self, origin=None, relativize=True, **kw)

source code 

Convert the RRset into DNS master file format.

Parameters:
  • origin (dns.name.Name object) - The origin for relative names, or None.
  • relativize (bool) - True if names should names be relativized
Overrides: rdataset.Rdataset.to_text

See Also: dns.name.Name.choose_relativity for more information on how origin and relativize determine the way names are emitted.

Any additional keyword arguments are passed on to the rdata to_text() method.

to_wire(self, file, compress=None, origin=None, **kw)

source code 

Convert the RRset to wire format.

Parameters:
  • name - The owner name of the RRset that will be emitted
  • file - The file to which the wire format data will be appended
  • compress - The compression table to use; the default is None.
  • origin - The origin to be appended to any relative names when they are emitted. The default is None.
Returns: int
the number of records emitted
Overrides: rdataset.Rdataset.to_wire