%PDF- %PDF-
Direktori : /proc/self/root/opt/plesk/python/2.7/lib/python2.7/site-packages/dns/ |
Current File : //proc/self/root/opt/plesk/python/2.7/lib/python2.7/site-packages/dns/rdataset.pyc |
� �ac @ s d Z d d l Z d d l m Z d d l Z d d l Z d d l Z d d l Z d d l Z d d l Z d d l m Z e j j Z d e j j f d � � YZ d e j j f d � � YZ d e j j f d � � YZ d � Z d � Z d � Z d � Z d S( sH DNS rdatasets (an rdataset is a set of rdatas of a given type and class)i����N( t StringIOi ( t string_typest DifferingCoversc B s e Z d Z RS( s~ An attempt was made to add a DNS SIG/RRSIG whose covered type is not the same as that of the other rdatas in the rdataset.( t __name__t __module__t __doc__( ( ( sA /opt/plesk/python/2.7/lib/python2.7/site-packages/dns/rdataset.pyR # s t IncompatibleTypesc B s e Z d Z RS( s? An attempt was made to add DNS RR data of an incompatible type.( R R R ( ( ( sA /opt/plesk/python/2.7/lib/python2.7/site-packages/dns/rdataset.pyR ( s t Rdatasetc B s� e Z d Z d d d d g Z e j j d d � Z d � Z d � Z d d � Z d � Z d � Z d � Z d � Z d � Z d � Z d � Z d d e d d � Z d d d e d � Z d � Z RS( s A DNS rdataset.t rdclasst rdtypet coverst ttli c C s; t t | � j � | | _ | | _ | | _ | | _ d S( s� Create a new rdataset of the specified class and type. *rdclass*, an ``int``, the rdataclass. *rdtype*, an ``int``, the rdatatype. *covers*, an ``int``, the covered rdatatype. *ttl*, an ``int``, the TTL. N( t superR t __init__R R R R ( t selfR R R R ( ( sA /opt/plesk/python/2.7/lib/python2.7/site-packages/dns/rdataset.pyR 2 s c C sI t t | � j � } | j | _ | j | _ | j | _ | j | _ | S( N( R R t _cloneR R R R ( R t obj( ( sA /opt/plesk/python/2.7/lib/python2.7/site-packages/dns/rdataset.pyR D s c C s= t | � d k r | | _ n | | j k r9 | | _ n d S( s� Perform TTL minimization. Set the TTL of the rdataset to be the lesser of the set's current TTL or the specified TTL. If the set contains no rdatas, set the TTL to the specified TTL. *ttl*, an ``int``. i N( t lenR ( R R ( ( sA /opt/plesk/python/2.7/lib/python2.7/site-packages/dns/rdataset.pyt update_ttlL s c C s | j | j k s$ | j | j k r- t � n | d k rI | j | � n | j t j j k ss | j t j j k r� | j � } t | � d k r� | j t j j k r� | | _ q� | j | k r� t � q� n t j j | j � rt | � d k r| j � n t t | � j | � d S( s! Add the specified rdata to the rdataset. If the optional *ttl* parameter is supplied, then ``self.update_ttl(ttl)`` will be called prior to adding the rdata. *rd*, a ``dns.rdata.Rdata``, the rdata *ttl*, an ``int``, the TTL. Raises ``dns.rdataset.IncompatibleTypes`` if the type and class do not match the type and class of the rdataset. Raises ``dns.rdataset.DifferingCovers`` if the type is a signature type and the covered type does not match that of the rdataset. i N( R R R t NoneR t dnst rdatatypet RRSIGt SIGR R t NONER t is_singletont clearR R t add( R t rdR R ( ( sA /opt/plesk/python/2.7/lib/python2.7/site-packages/dns/rdataset.pyR [ s $ '' c C s* | j | j � t t | � j | � d S( N( R R R R t union_update( R t other( ( sA /opt/plesk/python/2.7/lib/python2.7/site-packages/dns/rdataset.pyR � s c C s* | j | j � t t | � j | � d S( N( R R R R t intersection_update( R R ( ( sA /opt/plesk/python/2.7/lib/python2.7/site-packages/dns/rdataset.pyR � s c C s* | j | j � t t | � j | � d S( s� Add all rdatas in other to self. *other*, a ``dns.rdataset.Rdataset``, the rdataset from which to update. N( R R R R t update( R R ( ( sA /opt/plesk/python/2.7/lib/python2.7/site-packages/dns/rdataset.pyR � s c C sk | j d k r d } n d t j j | j � d } d t j j | j � d t j j | j � | d S( Ni t t (t )s <DNS t s rdataset>( R R R t to_textt rdataclassR R ( R t ctext( ( sA /opt/plesk/python/2.7/lib/python2.7/site-packages/dns/rdataset.pyt __repr__� s c C s | j � S( N( R% ( R ( ( sA /opt/plesk/python/2.7/lib/python2.7/site-packages/dns/rdataset.pyt __str__� s c C sc t | t � s t S| j | j k sI | j | j k sI | j | j k rM t St t | � j | � S( N( t isinstanceR t FalseR R R R t __eq__( R R ( ( sA /opt/plesk/python/2.7/lib/python2.7/site-packages/dns/rdataset.pyR, � s c C s | j | � S( N( R, ( R R ( ( sA /opt/plesk/python/2.7/lib/python2.7/site-packages/dns/rdataset.pyt __ne__� s c K s* | d k r3 | j | | � } t | � } d } n d } d } t � } | d k r] | } n | j } t | � d k r� | j d j | | t j j | � t j j | j � � � ng xd | D]\ } | j d | | | j t j j | � t j j | j � | j d | d | | � f � q� W| j � d S( sd Convert the rdataset into DNS master file format. See ``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. *name*, a ``dns.name.Name``. If name is not ``None``, emit RRs with *name* as the owner name. *origin*, a ``dns.name.Name`` or ``None``, the origin for relative names. *relativize*, a ``bool``. If ``True``, names will be relativized to *origin*. R$ R! i u {}{}{} {} u %s%s%d %s %s %s t origint relativizei����N( R t choose_relativityt strR R R t writet formatR R&