ok

Mini Shell

Direktori : /proc/self/root/lib64/python2.7/site-packages/dns/
Upload File :
Current File : //proc/self/root/lib64/python2.7/site-packages/dns/zone.pyo

�
`��Sc@s�dZddlmZddlZddlZddlZddlZddlZddl	Zddl
ZddlZddlZddl
ZddlZddlZyddlmZWn!ek
r�ddlmZnXdejjfd��YZdefd��YZd	efd
��YZdefd��YZd
efd��YZdefd��YZeejje eee!e d�Z"eejje eee e d�Z#ee e d�Z$dS(s
DNS Zones.i����(t
generatorsN(tStringIOtBadZonecBseZdZRS(sThe zone is malformed.(t__name__t
__module__t__doc__(((s./usr/lib64/python2.7/site-packages/dns/zone.pyR'stNoSOAcBseZdZRS(s%The zone has no SOA RR at its origin.(RRR(((s./usr/lib64/python2.7/site-packages/dns/zone.pyR+stNoNScBseZdZRS(s'The zone has no NS RRset at its origin.(RRR(((s./usr/lib64/python2.7/site-packages/dns/zone.pyR/st
UnknownOrigincBseZdZRS(sThe zone's origin is unknown.(RRR(((s./usr/lib64/python2.7/site-packages/dns/zone.pyR3stZonecBs�eZdZejjZddddgZejj	e
d�Zd�Zd�Z
d�Zd	�Zd
�Zd�Zd�Zd
�Zd�Zd�Zd�Zd�Zd�Zd�Zd�Zed�Zed�Zd�Zejj ed�Z!ejj ed�Z"ejj d�Z#d�Z$ejj d�Z%ejj d�Z&ejj'ejj d�Z(ejj'ejj d�Z)e
e
d#d �Z+e
e
d#d!�Z,d"�Z-RS($sZA DNS zone.

    A Zone is a mapping from names to nodes.  The zone object may be
    treated like a Python dictionary, e.g. zone[name] will retrieve
    the node associated with that name.  The I{name} may be a
    dns.name.Name object, or it may be a string.  In the either case,
    if the name is relative it is treated as relative to the origin of
    the zone.

    @ivar rdclass: The zone's rdata class; the default is class IN.
    @type rdclass: int
    @ivar origin: The origin of the zone.
    @type origin: dns.name.Name object
    @ivar nodes: A dictionary mapping the names of nodes in the zone to the
    nodes themselves.
    @type nodes: dict
    @ivar relativize: should names in the zone be relativized?
    @type relativize: bool
    @cvar node_factory: the factory used to create a new node
    @type node_factory: class or callable
    trdclasstorigintnodest
relativizecCs(||_||_i|_||_dS(s�Initialize a zone object.

        @param origin: The origin of the zone.
        @type origin: dns.name.Name object
        @param rdclass: The zone's rdata class; the default is class IN.
        @type rdclass: intN(R
RRR
(tselfRR
R
((s./usr/lib64/python2.7/site-packages/dns/zone.pyt__init__Rs			cCsQt|t�stS|j|jksI|j|jksI|j|jkrMtStS(siTwo zones are equal if they have the same origin, class, and
        nodes.
        @rtype: bool
        (t
isinstanceR	tFalseR
RRtTrue(Rtother((s./usr/lib64/python2.7/site-packages/dns/zone.pyt__eq___scCs|j|�S(s6Are two zones not equal?
        @rtype: bool
        (R(RR((s./usr/lib64/python2.7/site-packages/dns/zone.pyt__ne__mscCs�t|ttf�r-tjj|d�}n$t|tjj�sQtd��n|j	�r�|j
|j�s~td��n|jr�|j|j�}q�n|S(Ns0name parameter must be convertable to a DNS names5name parameter must be a subdomain of the zone origin(
Rtstrtunicodetdnstnamet	from_texttNonetNametKeyErrortis_absolutetis_subdomainRR
(RR((s./usr/lib64/python2.7/site-packages/dns/zone.pyt_validate_namets	cCs|j|�}|j|S(N(R R(Rtkey((s./usr/lib64/python2.7/site-packages/dns/zone.pyt__getitem__�scCs |j|�}||j|<dS(N(R R(RR!tvalue((s./usr/lib64/python2.7/site-packages/dns/zone.pyt__setitem__�scCs|j|�}|j|=dS(N(R R(RR!((s./usr/lib64/python2.7/site-packages/dns/zone.pyt__delitem__�scCs
|jj�S(N(Rtiterkeys(R((s./usr/lib64/python2.7/site-packages/dns/zone.pyt__iter__�scCs
|jj�S(N(RR&(R((s./usr/lib64/python2.7/site-packages/dns/zone.pyR&�scCs
|jj�S(N(Rtkeys(R((s./usr/lib64/python2.7/site-packages/dns/zone.pyR(�scCs
|jj�S(N(Rt
itervalues(R((s./usr/lib64/python2.7/site-packages/dns/zone.pyR)�scCs
|jj�S(N(Rtvalues(R((s./usr/lib64/python2.7/site-packages/dns/zone.pyR*�scCs
|jj�S(N(Rt	iteritems(R((s./usr/lib64/python2.7/site-packages/dns/zone.pyR+�scCs
|jj�S(N(Rtitems(R((s./usr/lib64/python2.7/site-packages/dns/zone.pyR,�scCs|j|�}|jj|�S(N(R Rtget(RR!((s./usr/lib64/python2.7/site-packages/dns/zone.pyR-�scCs
||jkS(N(R(RR((s./usr/lib64/python2.7/site-packages/dns/zone.pyt__contains__�scCs\|j|�}|jj|�}|dkrX|s<t�n|j�}||j|<n|S(srFind a node in the zone, possibly creating it.

        @param name: the name of the node to find
        @type name: dns.name.Name object or string
        @param create: should the node be created if it doesn't exist?
        @type create: bool
        @raises KeyError: the name is not known and create was not specified.
        @rtype: dns.node.Node object
        N(R RR-RRtnode_factory(RRtcreatetnode((s./usr/lib64/python2.7/site-packages/dns/zone.pyt	find_node�s	cCs4y|j||�}Wntk
r/d}nX|S(s�Get a node in the zone, possibly creating it.

        This method is like L{find_node}, except it returns None instead
        of raising an exception if the node does not exist and creation
        has not been requested.

        @param name: the name of the node to find
        @type name: dns.name.Name object or string
        @param create: should the node be created if it doesn't exist?
        @type create: bool
        @rtype: dns.node.Node object or None
        N(R2RR(RRR0R1((s./usr/lib64/python2.7/site-packages/dns/zone.pytget_node�s


cCs2|j|�}|jj|�r.|j|=ndS(shDelete the specified node if it exists.

        It is not an error if the node does not exist.
        N(R Rthas_key(RR((s./usr/lib64/python2.7/site-packages/dns/zone.pytdelete_node�scCs�|j|�}t|ttf�r9tjj|�}nt|ttf�rctjj|�}n|j||�}|j|j	|||�S(s�Look for rdata with the specified name and type in the zone,
        and return an rdataset encapsulating it.

        The I{name}, I{rdtype}, and I{covers} parameters may be
        strings, in which case they will be converted to their proper
        type.

        The rdataset returned is not a copy; changes to it will change
        the zone.

        KeyError is raised if the name or type are not found.
        Use L{get_rdataset} if you want to have None returned instead.

        @param name: the owner name to look for
        @type name: DNS.name.Name object or string
        @param rdtype: the rdata type desired
        @type rdtype: int or string
        @param covers: the covered type (defaults to None)
        @type covers: int or string
        @param create: should the node and rdataset be created if they do not
        exist?
        @type create: bool
        @raises KeyError: the node or rdata could not be found
        @rtype: dns.rrset.RRset object
        (
R RRRRt	rdatatypeRR2t
find_rdatasetR
(RRtrdtypetcoversR0R1((s./usr/lib64/python2.7/site-packages/dns/zone.pyR7�scCs:y|j||||�}Wntk
r5d}nX|S(s�Look for rdata with the specified name and type in the zone,
        and return an rdataset encapsulating it.

        The I{name}, I{rdtype}, and I{covers} parameters may be
        strings, in which case they will be converted to their proper
        type.

        The rdataset returned is not a copy; changes to it will change
        the zone.

        None is returned if the name or type are not found.
        Use L{find_rdataset} if you want to have KeyError raised instead.

        @param name: the owner name to look for
        @type name: DNS.name.Name object or string
        @param rdtype: the rdata type desired
        @type rdtype: int or string
        @param covers: the covered type (defaults to None)
        @type covers: int or string
        @param create: should the node and rdataset be created if they do not
        exist?
        @type create: bool
        @rtype: dns.rrset.RRset object
        N(R7RR(RRR8R9R0trdataset((s./usr/lib64/python2.7/site-packages/dns/zone.pytget_rdataset�s


cCs�|j|�}t|ttf�r9tjj|�}nt|ttf�rctjj|�}n|j|�}|dk	r�|j	|j
||�t|�dkr�|j|�q�ndS(s�Delete the rdataset matching I{rdtype} and I{covers}, if it
        exists at the node specified by I{name}.

        The I{name}, I{rdtype}, and I{covers} parameters may be
        strings, in which case they will be converted to their proper
        type.

        It is not an error if the node does not exist, or if there is no
        matching rdataset at the node.

        If the node has no rdatasets after the deletion, it will itself
        be deleted.

        @param name: the owner name to look for
        @type name: DNS.name.Name object or string
        @param rdtype: the rdata type desired
        @type rdtype: int or string
        @param covers: the covered type (defaults to None)
        @type covers: int or string
        iN(
R RRRRR6RR3Rtdelete_rdatasetR
tlenR5(RRR8R9R1((s./usr/lib64/python2.7/site-packages/dns/zone.pyR<scCsD|j|jkr!td��n|j|t�}|j|�dS(s:Replace an rdataset at name.

        It is not an error if there is no rdataset matching I{replacement}.

        Ownership of the I{replacement} object is transferred to the zone;
        in other words, this method does not store a copy of I{replacement}
        at the node, it stores I{replacement} itself.

        If the I{name} node does not exist, it is created.

        @param name: the owner name
        @type name: DNS.name.Name object or string
        @param replacement: the replacement rdataset
        @type replacement: dns.rdataset.Rdataset
        s#replacement.rdclass != zone.rdclassN(R
t
ValueErrorR2Rtreplace_rdataset(RRtreplacementR1((s./usr/lib64/python2.7/site-packages/dns/zone.pyR?@scCs�|j|�}t|ttf�r9tjj|�}nt|ttf�rctjj|�}n|j|j|j	||�}tj
j||j	||�}|j|�|S(s�Look for rdata with the specified name and type in the zone,
        and return an RRset encapsulating it.

        The I{name}, I{rdtype}, and I{covers} parameters may be
        strings, in which case they will be converted to their proper
        type.

        This method is less efficient than the similar
        L{find_rdataset} because it creates an RRset instead of
        returning the matching rdataset.  It may be more convenient
        for some uses since it returns an object which binds the owner
        name to the rdata.

        This method may not be used to create new nodes or rdatasets;
        use L{find_rdataset} instead.

        KeyError is raised if the name or type are not found.
        Use L{get_rrset} if you want to have None returned instead.

        @param name: the owner name to look for
        @type name: DNS.name.Name object or string
        @param rdtype: the rdata type desired
        @type rdtype: int or string
        @param covers: the covered type (defaults to None)
        @type covers: int or string
        @raises KeyError: the node or rdata could not be found
        @rtype: dns.rrset.RRset object
        (
R RRRRR6RRR7R
trrsettRRsettupdate(RRR8R9R:RA((s./usr/lib64/python2.7/site-packages/dns/zone.pyt
find_rrsetVs
cCs7y|j|||�}Wntk
r2d}nX|S(sJLook for rdata with the specified name and type in the zone,
        and return an RRset encapsulating it.

        The I{name}, I{rdtype}, and I{covers} parameters may be
        strings, in which case they will be converted to their proper
        type.

        This method is less efficient than the similar L{get_rdataset}
        because it creates an RRset instead of returning the matching
        rdataset.  It may be more convenient for some uses since it
        returns an object which binds the owner name to the rdata.

        This method may not be used to create new nodes or rdatasets;
        use L{find_rdataset} instead.

        None is returned if the name or type are not found.
        Use L{find_rrset} if you want to have KeyError raised instead.

        @param name: the owner name to look for
        @type name: DNS.name.Name object or string
        @param rdtype: the rdata type desired
        @type rdtype: int or string
        @param covers: the covered type (defaults to None)
        @type covers: int or string
        @rtype: dns.rrset.RRset object
        N(RDRR(RRR8R9RA((s./usr/lib64/python2.7/site-packages/dns/zone.pyt	get_rrset~s


ccs�t|ttf�r*tjj|�}nt|ttf�rTtjj|�}nxi|j�D][\}}xL|D]D}|tjjks�|j|krt|j	|krt||fVqtqtWqaWdS(s�Return a generator which yields (name, rdataset) tuples for
        all rdatasets in the zone which have the specified I{rdtype}
        and I{covers}.  If I{rdtype} is dns.rdatatype.ANY, the default,
        then all rdatasets will be matched.

        @param rdtype: int or string
        @type rdtype: int or string
        @param covers: the covered type (defaults to None)
        @type covers: int or string
        N(
RRRRR6RR+tANYR8R9(RR8R9RR1trds((s./usr/lib64/python2.7/site-packages/dns/zone.pytiterate_rdatasets�s

ccs�t|ttf�r*tjj|�}nt|ttf�rTtjj|�}nx�|j�D]r\}}xc|D][}|tjjks�|j|krt|j	|krtx"|D]}||j
|fVq�WqtqtWqaWdS(s�Return a generator which yields (name, ttl, rdata) tuples for
        all rdatas in the zone which have the specified I{rdtype}
        and I{covers}.  If I{rdtype} is dns.rdatatype.ANY, the default,
        then all rdatas will be matched.

        @param rdtype: int or string
        @type rdtype: int or string
        @param covers: the covered type (defaults to None)
        @type covers: int or string
        N(RRRRR6RR+RFR8R9tttl(RR8R9RR1RGtrdata((s./usr/lib64/python2.7/site-packages/dns/zone.pytiterate_rdatas�s


cCstjdkrt}nt}|dkr3d}nd}t||�r`t||�}t}nt}z�|r�|j	�}|j
�n|j�}xc|D][}	||	j|	d|j
d|�}
|dkr�||
IJq�|j|
�|j|�q�WWd|r|j�nXdS(sWrite a zone to a file.

        @param f: file or string.  If I{f} is a string, it is treated
        as the name of a file to open.
        @param sorted: if True, the file will be written with the
        names sorted in DNSSEC order from least to greatest.  Otherwise
        the names will be written in whatever order they happen to have
        in the zone's dictionary.
        @param relativize: if True, domain names in the output will be
        relativized to the zone's origin (if possible).
        @type relativize: bool
        @param nl: The end of line string.  If not specified, the
        output will use the platform's native end-of-line marker (i.e.
        LF on POSIX, CRLF on Windows, CR on Macintosh).
        @type nl: string or None
        itwtwbRR
N(tsyst
hexversiont
basestringRRRtfileRRR(tsortR&tto_textRtwritetclose(RtftsortedR
tnltstr_typetoptst
want_closetnamestntl((s./usr/lib64/python2.7/site-packages/dns/zone.pytto_file�s0			

	

cCs9t�}|j||||�|j�}|j�|S(s�Return a zone's text as though it were written to a file.

        @param sorted: if True, the file will be written with the
        names sorted in DNSSEC order from least to greatest.  Otherwise
        the names will be written in whatever order they happen to have
        in the zone's dictionary.
        @param relativize: if True, domain names in the output will be
        relativized to the zone's origin (if possible).
        @type relativize: bool
        @param nl: The end of line string.  If not specified, the
        output will use the platform's native end-of-line marker (i.e.
        LF on POSIX, CRLF on Windows, CR on Macintosh).
        @type nl: string or None
        (RR_tgetvalueRU(RRWR
RXttemp_buffertreturn_value((s./usr/lib64/python2.7/site-packages/dns/zone.pyRSs
	
cCss|jrtjj}n	|j}|j|tjj�dkrHt	�n|j|tjj
�dkrot�ndS(s�Do some simple checking of the zone's origin.

        @raises dns.zone.NoSOA: there is no SOA RR
        @raises dns.zone.NoNS: there is no NS RRset
        @raises KeyError: there is no origin node
        N(R
RRtemptyRR;R6tSOARRtNSR(RR((s./usr/lib64/python2.7/site-packages/dns/zone.pytcheck_origins			N(.RRRRR1tNodeR/t	__slots__t
rdataclasstINRRRRR R"R$R%R'R&R(R)R*R+R,R-R.RR2R3R5R6tNONER7R;R<R?RDRERFRHRKRR_RSRf(((s./usr/lib64/python2.7/site-packages/dns/zone.pyR	7sJ
																
	#	 !	("		2t
_MasterReadercBsMeZdZeeed�Zd�Zd�Zd�Z	d�Z
d�ZRS(s�Read a DNS master file

    @ivar tok: The tokenizer
    @type tok: dns.tokenizer.Tokenizer object
    @ivar ttl: The default TTL
    @type ttl: int
    @ivar last_name: The last name read
    @type last_name: dns.name.Name object
    @ivar current_origin: The current origin
    @type current_origin: dns.name.Name object
    @ivar relativize: should names in the zone be relativized?
    @type relativize: bool
    @ivar zone: the zone
    @type zone: dns.zone.Zone object
    @ivar saved_state: saved reader state (used when processing $INCLUDE)
    @type saved_state: list of (tokenizer, current_origin, last_name, file)
    tuples.
    @ivar current_file: the file object of the $INCLUDed file being parsed
    (None if no $INCLUDE is active).
    @ivar allow_include: is $INCLUDE allowed?
    @type allow_include: bool
    @ivar check_origin: should sanity checks of the origin node be done?
    The default is True.
    @type check_origin: bool
    cCs�t|ttf�r*tjj|�}n||_||_||_d|_	|j|_
|||d|�|_g|_d|_||_||_dS(NiR
(RRRRRRttoktcurrent_originR
RIt	last_nametzonetsaved_stateRtcurrent_filet
allow_includeRf(RRmRR
R
tzone_factoryRsRf((s./usr/lib64/python2.7/site-packages/dns/zone.pyRBs							cCs)x"|jj�}|j�rPqqdS(N(RmR-t
is_eol_or_eof(Rttoken((s./usr/lib64/python2.7/site-packages/dns/zone.pyt	_eat_lineQscCsz|jdkrt�n|jjdt�}|j�sZtjj	|j
|j�|_n/|jj�}|j�rydS|jj
|�|j}|j|jj�s�|j�dS|jr�|j|jj�}n|jj�}|j�stjj�nyCtjj	|j
�}|jj�}|j�sBtjj�nWn tjjk
re|j}nXyCtjj	|j
�}|jj�}|j�s�tjj�nWn5tjjk
r�tjj�n|jj}nX||jjkrtjjd��nytjj	|j
�}Wn tjjd|j
��nX|jjj|�}|dkr�|jj�}||jj|<ny(tjj	|||j|jt�}Wnwtjjk
r�tj �d \}}	|	�nEtj �d \}}	tjjdt!|�t!|	�f��nX|j"|jj|j�|j#�}
|j$|||
t�}|j%||�dS(s(Process one line from a DNS master file.twant_leadingNsRR class is not zone's classsunknown rdatatype '%s'iscaught exception %s: %s(&RnRRRmR-Rt
is_whitespaceRRRR#RoRutungetRRpRRwR
t
is_identifiert	exceptiontSyntaxErrorRItBadTTLRiR
R6RR/RJRRNtexc_infoRtchoose_relativityR9R7tadd(RRvRRIR
R8R]trdttytvaR9RG((s./usr/lib64/python2.7/site-packages/dns/zone.pyt_rr_lineWsr	!	
	
	,c
Csytjd�}tjd�}tjd�}|j|�}|ru|j�\}}}}	}
|dkrud}qun|j|�}|r�|j�\}}}|dkr�d}nd}	d}
n|j|�}|r|j�\}}}}	|dkrd}n|j�d}	d}
n|p-|p-|sQd}d}d}d}	d}
n|
dkrft�n||||	|
fS(	Ns"^.*\$({(\+|-?)(\d+),(\d+),(.)}).*$s^.*\$({(\+|-?)(\d+)}).*$s^.*\$({(\+|-?)(\d+),(\d+)}).*$tt+itdi(tretcompiletmatchtgroupstNotImplemented(
Rtsidetis_generate1tis_generate2tis_generate3tg1tmodtsigntoffsettwidthtbasetg2tg3((s./usr/lib64/python2.7/site-packages/dns/zone.pyt
_parse_modify�s>						c!Cs=|jdkrt�n|jj�}yLtjj|j�\}}}|jj�}|j	�srtj
j�nWntj
j�nXy7|j}|jj�}|j	�s�tj
j�nWntj
j�nXyCtjj|j�}|jj�}|j	�stj
j�nWn tjj
k
r;|j}nXyCtjj|j�}|jj�}|j	�s~tj
j�nWn5tj
jk
r�tj
j�n|jj}nX||jjkr�tj
jd��nyCtjj|j�}|jj�}|j	�s tj
j�nWn tj
jd|j��nXy
|j}	Wntj
j�nX|j|�\}
}}}
}|j|	�\}}}}}x�t||d|�D]{}|dkr�|t|�}n|dkr�|t|�}n|dkr|t|�}n|dkr<|t|�}nt|�jt|
��}t|�jt|��}|jd|
|�}|	jd||�}tjj||j�|_|j}|j|jj�s�|j�dS|jr|j|jj�}n|jjj|�}|dkrI|jj�}||jj|<ny%tj j||||jt!�}Wnwtj
jk
r�t"j#�d \}}|�nEt"j#�d \}}tj
jd	t|�t|�f��nX|j$|jj|j�|j%�}|j&|||t'�} | j(||�q�WdS(
sRProcess one line containing the GENERATE statement from a DNS
        master file.sRR class is not zone's classsunknown rdatatype '%s'iR�t-s$%sNiscaught exception %s: %s()RnRRRmR-RtgrangeRR#R{R|R}RIR~RiRpR
R6R�trangetintRtzfilltreplaceRRoRRRwR
RR/RJRRNRR�R9R7RR�(!RRvtstarttstoptsteptlhsRIR
R8trhstlmodtlsigntloffsettlwidthtlbasetrmodtrsigntroffsettrwidthtrbasetitlindextrindextlzfindextrzfindexRRJR]R�R�R�R9RG((s./usr/lib64/python2.7/site-packages/dns/zone.pyt_generate_line�s�		

	
		 cCs{y�x�|jjtt�}|j�r�|jdk	rF|jj�nt|j�dkr�|jj	d�\|_|_
|_|_|_qnPnF|j
�r�qn4|j�r�|jj�qn|jddkr�|jj�}|dkrL|jj�}|j�s$tjjd��ntjj|j�|_|jj�q|dkr�|jj�|_
|jj�|jjdkr�|j
|j_q�q|dkr�|jr�|jj�}|j}|jj�}|j�rtjj|j|j
�}|jj�n*|j�s2tjjd��n	|j
}|jj|j|j
|j|j|jf�t|d	�|_tjj |j|�|_||_
q|d
kr�|j!�qtjjd|d��qn|jj"|�|j#�qWnbtjjk
r]}|jj$�\}}|dkr;d
}ntjjd|||f��nX|j%rw|jj%�ndS(s�Read a DNS master file and build a zone object.

        @raises dns.zone.NoSOA: No SOA RR was found at the zone origin
        @raises dns.zone.NoNS: No NS RRset was found at the zone origin
        ii����t$s$TTLsbad $TTLs$ORIGINs$INCLUDEsbad origin in $INCLUDEtrs	$GENERATEsUnknown master file directive 't'ssyntax errors	%s:%d: %sN(&RmR-Rtis_eofRrRRUR=RqtpopRnRoRItis_eolt
is_commenttget_eolR#tupperR{RR|R}Rtget_nameRpRRsRRutappendRQt	tokenizert	TokenizerR�RzR�twhereRf(RRvtutfilenamet
new_origintdetailtline_number((s./usr/lib64/python2.7/site-packages/dns/zone.pytread@sz0

		

	#	(RRRR	RRRRwR�R�R�R�(((s./usr/lib64/python2.7/site-packages/dns/zone.pyRl's		I	)	wc

Cs_|dkrd}ntjj||�}t|||||d|d|�}	|	j�|	jS(srBuild a zone object from a master file format string.

    @param text: the master file format input
    @type text: string.
    @param origin: The origin of the zone; if not specified, the first
    $ORIGIN statement in the master file will determine the origin of the
    zone.
    @type origin: dns.name.Name object or string
    @param rdclass: The zone's rdata class; the default is class IN.
    @type rdclass: int
    @param relativize: should names be relativized?  The default is True
    @type relativize: bool
    @param zone_factory: The zone factory to use
    @type zone_factory: function returning a Zone
    @param filename: The filename to emit when describing where an error
    occurred; the default is '<string>'.
    @type filename: string
    @param allow_include: is $INCLUDE allowed?
    @type allow_include: bool
    @param check_origin: should sanity checks of the origin node be done?
    The default is True.
    @type check_origin: bool
    @raises dns.zone.NoSOA: No SOA RR was found at the zone origin
    @raises dns.zone.NoNS: No NS RRset was found at the zone origin
    @rtype: dns.zone.Zone object
    s<string>RsRfN(RRR�R�RlR�Rp(
ttextRR
R
RtR�RsRfRmtreader((s./usr/lib64/python2.7/site-packages/dns/zone.pyR�s"		
c	Cs�tjdkrt}d}	nt}d}	t||�rf|dkrN|}nt||	�}t}
n|dkr{d}nt}
z%t	||||||||�}Wd|
r�|j
�nX|S(s�Read a master file and build a zone object.

    @param f: file or string.  If I{f} is a string, it is treated
    as the name of a file to open.
    @param origin: The origin of the zone; if not specified, the first
    $ORIGIN statement in the master file will determine the origin of the
    zone.
    @type origin: dns.name.Name object or string
    @param rdclass: The zone's rdata class; the default is class IN.
    @type rdclass: int
    @param relativize: should names be relativized?  The default is True
    @type relativize: bool
    @param zone_factory: The zone factory to use
    @type zone_factory: function returning a Zone
    @param filename: The filename to emit when describing where an error
    occurred; the default is '<file>', or the value of I{f} if I{f} is a
    string.
    @type filename: string
    @param allow_include: is $INCLUDE allowed?
    @type allow_include: bool
    @param check_origin: should sanity checks of the origin node be done?
    The default is True.
    @type check_origin: bool
    @raises dns.zone.NoSOA: No SOA RR was found at the zone origin
    @raises dns.zone.NoNS: No NS RRset was found at the zone origin
    @rtype: dns.zone.Zone object
    itrUR�s<file>N(RNRORPRRRRQRRRRU(RVRR
R
RtR�RsRfRYRZR[tz((s./usr/lib64/python2.7/site-packages/dns/zone.pyt	from_file�s&				cCs4d}x|D]}|dkri|r1|j}n|jdj}|jdj}|||d|�}nx�|jD]�}|jj|j�}	|	s�|j�}	|	|j|j<n|	j|j|j	|j
t�}
|
j|j
�x.|D]&}|j|j|�|
j|�q�WqsWq
W|r0|j�n|S(s�Convert the output of a zone transfer generator into a zone object.

    @param xfr: The xfr generator
    @type xfr: generator of dns.message.Message objects
    @param relativize: should names be relativized?  The default is True.
    It is essential that the relativize setting matches the one specified
    to dns.query.xfr().
    @type relativize: bool
    @param check_origin: should sanity checks of the origin node be done?
    The default is True.
    @type check_origin: bool
    @raises dns.zone.NoSOA: No SOA RR was found at the zone origin
    @raises dns.zone.NoNS: No NS RRset was found at the zone origin
    @rtype: dns.zone.Zone object
    iR
N(RRtanswerRR
RR-R/R7R8R9Rt
update_ttlRIR�R�Rf(txfrRtR
RfR�R�RR
RAtznodetzrdsR�((s./usr/lib64/python2.7/site-packages/dns/zone.pytfrom_xfr�s,


(%Rt
__future__RRNR�t
dns.exceptionRtdns.nametdns.nodetdns.rdataclasst
dns.rdatatypet	dns.rdatat	dns.rrsett
dns.tokenizertdns.ttlt
dns.granget	cStringIORtImportErrortioR|tDNSExceptionRRRRtobjectR	RlRRiRjRRRR�R�(((s./usr/lib64/python2.7/site-packages/dns/zone.pyt<module>s@
���g	)	6

Zerion Mini Shell 1.0