Why Gemfury? Push, build, and install  RubyGems npm packages Python packages Maven artifacts PHP packages Go Modules Debian packages RPM packages NuGet packages

Repository URL to install this package:

Details    
Size: Mime:
ó
 ‹EYc@sÒdZddlmZddlZddlZddlZddlmZddlZ	ddl
Z	ddlZ	ddlZ	ddl
Z	ddlZ	ddlZ	ddlZ	ddlZ	ddlZ	ddlmZmZejdfkZde	jjfd	„ƒYZd
efd„ƒYZdefd
„ƒYZdefd„ƒYZdefd„ƒYZdefd„ƒYZ e!e	j"j#e$ee!e%e$d„Z&e!e	j"j#e$ee!e$e$d„Z'ee$e$d„Z(dS(s
DNS Zones.iÿÿÿÿ(t
generatorsN(tBytesIOi(tstring_typest	text_typeitBadZonecBseZdZRS(sThe DNS zone is malformed.(t__name__t
__module__t__doc__(((sN/home/tvault/.virtenv/lib/python2.7/site-packages/eventlet/support/dns/zone.pyR)stNoSOAcBseZdZRS(s)The DNS zone has no SOA RR at its origin.(RRR(((sN/home/tvault/.virtenv/lib/python2.7/site-packages/eventlet/support/dns/zone.pyR.stNoNScBseZdZRS(s+The DNS zone has no NS RRset at its origin.(RRR(((sN/home/tvault/.virtenv/lib/python2.7/site-packages/eventlet/support/dns/zone.pyR	3st
UnknownOrigincBseZdZRS(s!The DNS zone's origin is unknown.(RRR(((sN/home/tvault/.virtenv/lib/python2.7/site-packages/eventlet/support/dns/zone.pyR
8stZonecBs²eZdZejjZddddgZejj	e
d„Zd„Zd„Z
d„Zd	„Zd
„Zd„Zd„Zd
„Zd„Zd„Zd„Zd„ZeZd„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š|dk	rrt|tƒr0tjj|ƒ}n$t|tjjƒsTtdƒ‚n|jƒsrtdƒ‚qrn||_	||_
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: ints2origin parameter must be convertible to a DNS names)origin parameter must be an absolute nameN(
tNonet
isinstanceRtdnstnamet	from_texttNamet
ValueErrortis_absoluteR
RRR(tselfR
RR((sN/home/tvault/.virtenv/lib/python2.7/site-packages/eventlet/support/dns/zone.pyt__init__Ys			cCsQt|tƒstS|j|jksI|j|jksI|j|jkrMtStS(siTwo zones are equal if they have the same origin, class, and
        nodes.
        @rtype: bool
        (RRtFalseRR
RtTrue(Rtother((sN/home/tvault/.virtenv/lib/python2.7/site-packages/eventlet/support/dns/zone.pyt__eq__nscCs|j|ƒS(s6Are two zones not equal?
        @rtype: bool
        (R(RR((sN/home/tvault/.virtenv/lib/python2.7/site-packages/eventlet/support/dns/zone.pyt__ne__|scCst|tƒr'tjj|dƒ}n$t|tjjƒsKtdƒ‚n|jƒr™|j	|j
ƒsxtdƒ‚n|jr™|j|j
ƒ}q™n|S(Ns0name parameter must be convertible to a DNS names5name parameter must be a subdomain of the zone origin(RRRRRRRtKeyErrorRtis_subdomainR
R(RR((sN/home/tvault/.virtenv/lib/python2.7/site-packages/eventlet/support/dns/zone.pyt_validate_nameƒs	cCs|j|ƒ}|j|S(N(R!R(Rtkey((sN/home/tvault/.virtenv/lib/python2.7/site-packages/eventlet/support/dns/zone.pyt__getitem__scCs |j|ƒ}||j|<dS(N(R!R(RR"tvalue((sN/home/tvault/.virtenv/lib/python2.7/site-packages/eventlet/support/dns/zone.pyt__setitem__”scCs|j|ƒ}|j|=dS(N(R!R(RR"((sN/home/tvault/.virtenv/lib/python2.7/site-packages/eventlet/support/dns/zone.pyt__delitem__˜scCs
|jjƒS(N(Rt__iter__(R((sN/home/tvault/.virtenv/lib/python2.7/site-packages/eventlet/support/dns/zone.pyR'œscCs$tr|jjƒS|jjƒSdS(N(t_py3Rtkeystiterkeys(R((sN/home/tvault/.virtenv/lib/python2.7/site-packages/eventlet/support/dns/zone.pyR*Ÿs
cCs
|jjƒS(N(RR)(R((sN/home/tvault/.virtenv/lib/python2.7/site-packages/eventlet/support/dns/zone.pyR)¥scCs$tr|jjƒS|jjƒSdS(N(R(Rtvaluest
itervalues(R((sN/home/tvault/.virtenv/lib/python2.7/site-packages/eventlet/support/dns/zone.pyR,¨s
cCs
|jjƒS(N(RR+(R((sN/home/tvault/.virtenv/lib/python2.7/site-packages/eventlet/support/dns/zone.pyR+®scCs
|jjƒS(N(Rtitems(R((sN/home/tvault/.virtenv/lib/python2.7/site-packages/eventlet/support/dns/zone.pyR-±scCs|j|ƒ}|jj|ƒS(N(R!Rtget(RR"((sN/home/tvault/.virtenv/lib/python2.7/site-packages/eventlet/support/dns/zone.pyR.¶scCs
||jkS(N(R(RR((sN/home/tvault/.virtenv/lib/python2.7/site-packages/eventlet/support/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!RR.RRtnode_factory(RRtcreatetnode((sN/home/tvault/.virtenv/lib/python2.7/site-packages/eventlet/support/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(R3RR(RRR1R2((sN/home/tvault/.virtenv/lib/python2.7/site-packages/eventlet/support/dns/zone.pytget_nodeÑs


cCs/|j|ƒ}||jkr+|j|=ndS(shDelete the specified node if it exists.

        It is not an error if the node does not exist.
        N(R!R(RR((sN/home/tvault/.virtenv/lib/python2.7/site-packages/eventlet/support/dns/zone.pytdelete_nodeåscCs‚|j|ƒ}t|tƒr3tjj|ƒ}nt|tƒrWtjj|ƒ}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!RRRt	rdatatypeRR3t
find_rdatasetR(RRtrdtypetcoversR1R2((sN/home/tvault/.virtenv/lib/python2.7/site-packages/eventlet/support/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(RRR8R9R1trdataset((sN/home/tvault/.virtenv/lib/python2.7/site-packages/eventlet/support/dns/zone.pytget_rdatasets


cCs±|j|ƒ}t|tƒr3tjj|ƒ}nt|tƒrWtjj|ƒ}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!RRRR6RR4Rtdelete_rdatasetRtlenR5(RRR8R9R2((sN/home/tvault/.virtenv/lib/python2.7/site-packages/eventlet/support/dns/zone.pyR<4s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RR3Rtreplace_rdataset(RRtreplacementR2((sN/home/tvault/.virtenv/lib/python2.7/site-packages/eventlet/support/dns/zone.pyR>UscCs¥|j|ƒ}t|tƒr3tjj|ƒ}nt|tƒrWtjj|ƒ}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!RRRR6RRR7RtrrsettRRsettupdate(RRR8R9R:R@((sN/home/tvault/.virtenv/lib/python2.7/site-packages/eventlet/support/dns/zone.pyt
find_rrsetks
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(RCRR(RRR8R9R@((sN/home/tvault/.virtenv/lib/python2.7/site-packages/eventlet/support/dns/zone.pyt	get_rrset“s


ccs¸t|tƒr$tjj|ƒ}nt|tƒrHtjj|ƒ}nxi|jƒD][\}}xL|D]D}|tjjksž|j|krh|j|krh||fVqhqhWqUWdS(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(	RRRR6Rt	iteritemstANYR8R9(RR8R9RR2trds((sN/home/tvault/.virtenv/lib/python2.7/site-packages/eventlet/support/dns/zone.pytiterate_rdatasetsµs

ccsÏt|tƒr$tjj|ƒ}nt|tƒrHtjj|ƒ}nx€|jƒD]r\}}xc|D][}|tjjksž|j|krh|j|krhx"|D]}||j	|fVq¥WqhqhWqUWdS(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(
RRRR6RRERFR8R9tttl(RR8R9RR2RGtrdata((sN/home/tvault/.virtenv/lib/python2.7/site-packages/eventlet/support/dns/zone.pytiterate_rdatasÌs


cCs°t|tƒr't|dƒ}t}nt}t|ddƒ}|dkrTd}n|dkr{tjj	|ƒ}d}n3t|tƒrœ|j	|ƒ}n|}|j
ƒ}zç|rÖt|jƒƒ}|j
ƒn|jƒ}x¯|D]§}	||	j|	d|jd|ƒ}
t|
tƒr2|
j	|ƒ}n|
}|
j
ƒ}
y|j|ƒ|j|ƒWqétk
r|j|
ƒ|j|ƒqéXqé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
        twbtencodingsutf-8u
R
RN(RRtopenRRtgetattrRtostlineseptencodetdecodetlistR)tsortR*tto_textR
Rtwritet	TypeErrortclose(RtftsortedRtnlt
want_closetfile_enctnl_btnamestntltl_b((sN/home/tvault/.virtenv/lib/python2.7/site-packages/eventlet/support/dns/zone.pytto_fileäsD			

	


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
        (RRdtgetvalueRY(RR[RR\ttemp_buffertreturn_value((sN/home/tvault/.virtenv/lib/python2.7/site-packages/eventlet/support/dns/zone.pyRV$s
	
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(RRRtemptyR
R;R6tSOARRtNSR	(RR((sN/home/tvault/.virtenv/lib/python2.7/site-packages/eventlet/support/dns/zone.pytcheck_origin9s			N(.RRRRR2tNodeR0t	__slots__t
rdataclasstINRRRRR!R#R%R&R'R*R)R,R+R-RER.R/RR3R4R5R6tNONER7R;R<R>RCRDRFRHRKRRdRVRk(((sN/home/tvault/.virtenv/lib/python2.7/site-packages/eventlet/support/dns/zone.pyR=sJ			
												
	#	 !	("		@t
_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|tƒr$tjj|ƒ}n||_||_||_d|_|j|_	|||d|ƒ|_
g|_d|_
||_||_dS(NiR(RRRRRttoktcurrent_originRRIt	last_nametzonetsaved_stateRtcurrent_filet
allow_includeRk(RRrR
RRtzone_factoryRxRk((sN/home/tvault/.virtenv/lib/python2.7/site-packages/eventlet/support/dns/zone.pyRfs							cCs*x#|jjƒ}|jƒrPqqWdS(N(RrR.t
is_eol_or_eof(Rttoken((sN/home/tvault/.virtenv/lib/python2.7/site-packages/eventlet/support/dns/zone.pyt	_eat_lineuscCs„|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‚nWn?tjjk
rÎtjj‚ntk
rê|jj}nX||jjkrtjjdƒ‚nytjj	|j
ƒ}Wn tjjd|j
ƒ‚nX|jjj|ƒ}|dkr‘|jjƒ}||jj|<ny(tjj	|||j|jtƒ}Wnwtjjk
rît j!ƒd \}}	|	‚nEt j!ƒ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('RsRR
RrR.Rt
is_whitespaceRRRR$RtRztungetR RuR
R|Rt
is_identifiert	exceptiontSyntaxErrorRItBadTTLRnt	ExceptionRR6RR0RJRtsystexc_infotstrtchoose_relativityR9R7tadd(RR{RRIRR8RatrdttytvaR9RG((sN/home/tvault/.virtenv/lib/python2.7/site-packages/eventlet/support/dns/zone.pyt_rr_line{sx			
	

			#c
Cs|tjdƒ}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|
dkritƒ‚n||||	|
fS(	Ns"^.*\$({(\+|-?)(\d+),(\d+),(.)}).*$s^.*\$({(\+|-?)(\d+)}).*$s^.*\$({(\+|-?)(\d+),(\d+)}).*$tt+itdi(tretcompiletmatchtgroupstNotImplementedError(
Rtsidetis_generate1tis_generate2tis_generate3tg1tmodtsigntoffsettwidthtbasetg2tg3((sN/home/tvault/.virtenv/lib/python2.7/site-packages/eventlet/support/dns/zone.pyt
_parse_modifyÇs>					c!CsQ|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‚nWn?tj
jk
r¤tj
j‚ntk
rÀ|jj}nX||jjkrètj
jdƒ‚nyCtjj|jƒ}|jjƒ}|j	ƒs*tj
j‚nWn*tk
rWtj
jd|jƒ‚nXy
|j}	Wntj
j‚nX|j|ƒ\}
}}}
}|j|	ƒ\}}}}}x“t||d|ƒD]{}|dkró|t|ƒ}n|dkr|t|ƒ}n|dkr1|t|ƒ}n|dkrP|t|ƒ}nt|ƒjt|
ƒƒ}t|ƒjt|ƒƒ}|jd|
|ƒ}|	jd||ƒ}tjj||jƒ|_|j}|j|jjƒsù|jƒdS|jr|j|jjƒ}n|jjj|ƒ}|dkr]|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'iu+u-u$%sNiscaught exception %s: %s(*RsRR
RrR.RtgrangeRR$R€RR‚RIRƒRnR„RuRR6R¢trangetintR‡tzfilltreplaceRRtR R
R|RRR0RJRR…R†RˆR9R7RR‰(!RR{tstarttstoptsteptlhsRIRR8trhstlmodtlsigntloffsettlwidthtlbasetrmodtrsigntroffsettrwidthtrbasetitlindextrindextlzfindextrzfindexRRJRaRŠR‹RŒR9RG((sN/home/tvault/.virtenv/lib/python2.7/site-packages/eventlet/support/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#ƒqWWnbtjjk
r^}|jj$ƒ\}}|dkr<d
}ntjjd|||fƒ‚nX|j%rx|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ÿÿÿÿu$u$TTLsbad $TTLu$ORIGINu$INCLUDEsbad origin in $INCLUDEtru	$GENERATEsUnknown master file directive 't'ssyntax errors	%s:%d: %sN(&RrR.Rtis_eofRwRRYR=RvtpopRsRtRItis_eolt
is_commenttget_eolR$tupperR€RRR‚Rtget_nameRuR
RxRRztappendRNt	tokenizert	TokenizerR¼RRtwhereRk(RR{tctfilenamet
new_origintdetailtline_number((sN/home/tvault/.virtenv/lib/python2.7/site-packages/eventlet/support/dns/zone.pytreades€0

			

				(RRRRRRRR|RR¢R¼RÏ(((sN/home/tvault/.virtenv/lib/python2.7/site-packages/eventlet/support/dns/zone.pyRqJs		L	)	uc

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>RxRkN(RRRÇRÈRqRÏRu(
ttextR
RRRyRËRxRkRrtreader((sN/home/tvault/.virtenv/lib/python2.7/site-packages/eventlet/support/dns/zone.pyR·s"		
c	Cs£t}d}	t||ƒrH|dkr0|}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
    trUs<file>N(RRRRNRRRRY(RZR
RRRyRËRxRktstr_typetoptsR]tz((sN/home/tvault/.virtenv/lib/python2.7/site-packages/eventlet/support/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
    iRN(RR
tanswerRRRR.R0R7R8R9Rt
update_ttlRIRˆR‰Rk(txfrRyRRkRÕR½R
RR@tznodetzrdsRŠ((sN/home/tvault/.virtenv/lib/python2.7/site-packages/eventlet/support/dns/zone.pytfrom_xfrs,


()Rt
__future__RR…R‘RPtioRt
dns.exceptionRtdns.nametdns.nodetdns.rdataclasst
dns.rdatatypet	dns.rdatat	dns.rrsett
dns.tokenizertdns.ttlt
dns.granget_compatRRtversion_infoR(RtDNSExceptionRRR	R
tobjectRRqRRnRoRRRRÖRÜ(((sN/home/tvault/.virtenv/lib/python2.7/site-packages/eventlet/support/dns/zone.pyt<module>sBÿÿÿn	*	3