Viewing File: /opt/alt/python35/lib64/python3.5/site-packages/yaml/__pycache__/__init__.cpython-35.opt-1.pyc



:[%@sQddlTddlTddlTddlTddlTddlTdZyddlTdZWne	k
rpdZYnXddl
Z
eddZed	d
Z
eddZed
dZeddZeddZddZddZdedddddddZdeddddddddddddZdeddZdeddddddddddddddZdedd Zdd!d"Zdd#d$Zdeed%d&Zdeed'd(Zed)d*Zed+d,Zed-d.Z ed/d0Z!Gd1d2d2e"Z#Gd3d4d4d5e#Z$dS)6)*z3.13TFNc
cs@||}z"x|jr,|jVqWWd|jXdS)z9
    Scan a YAML stream and produce scanning tokens.
    N)Zcheck_tokenZ	get_tokendispose)streamLoaderloaderr/__init__.pyscans
r
c
cs@||}z"x|jr,|jVqWWd|jXdS)z9
    Parse a YAML stream and produce parsing events.
    N)Zcheck_eventZ	get_eventr)rrrrrr	parses
rc
Cs,||}z|jSWd|jXdS)zj
    Parse the first YAML document in a stream
    and produce the corresponding representation tree.
    N)Zget_single_noder)rrrrrr	compose*src
cs@||}z"x|jr,|jVqWWd|jXdS)zb
    Parse all YAML documents in a stream
    and produce corresponding representation trees.
    N)Z
check_nodeZget_noder)rrrrrr	compose_all5s
r
c
Cs,||}z|jSWd|jXdS)zd
    Parse the first YAML document in a stream
    and produce the corresponding Python object.
    N)Zget_single_datar)rrrrrr	loadAsrc
cs@||}z"x|jr,|jVqWWd|jXdS)z\
    Parse all YAML documents in a stream
    and produce corresponding Python objects.
    N)Z
check_dataget_datar)rrrrrr	load_allLs
rcCs
t|tS)z
    Parse the first YAML document in a stream
    and produce the corresponding Python object.
    Resolve only basic YAML tags.
    )r
SafeLoader)rrrr		safe_loadXsrcCs
t|tS)z~
    Parse all YAML documents in a stream
    and produce corresponding Python objects.
    Resolve only basic YAML tags.
    )rr)rrrr	
safe_load_all`srcCsd}|dkr'tj}|j}||d|d|d|d|d|}	z"x|D]}
|	j|
q[WWd|	jX|r|SdS)zl
    Emit YAML parsing events into a stream.
    If stream is None, return the produced string instead.
    N	canonicalindentwidth
allow_unicode
line_break)ioStringIOgetvalueemitr)eventsrDumperrrrrrrdumpereventrrr	rhs	
rc
Csd}
|dkrB|dkr-tj}ntj}|j}
||d|d|d|d|d|d|d|d	|d
|	d|

}z6|jx|D]}|j|qW|jWd|jX|
r|
SdS)z
    Serialize a sequence of representation trees into a YAML stream.
    If stream is None, return the produced string instead.
    Nrrrrrencodingversiontagsexplicit_startexplicit_end)rrBytesIOropen	serializecloser)nodesrrrrrrrr!r$r%r"r#rrnoderrr	
serialize_all}s$		

r,cKst|g|d||S)zx
    Serialize a representation tree into a YAML stream.
    If stream is None, return the produced string instead.
    r)r,)r+rrkwdsrrr	r(sr(cCsd}|dkrB|
dkr-tj}ntj}|j}||d|d|d|d|d|d|d|	d	|
d
|
d|d|d
|}z6|jx|D]}|j|qW|jWd|jX|r|SdS)z
    Serialize a sequence of Python objects into a YAML stream.
    If stream is None, return the produced string instead.
    N
default_styledefault_flow_stylerrrrrr!r"r#r$r%)rrr&rr'Z	representr)r)	documentsrrr.r/rrrrrr!r$r%r"r#rrdatarrr	dump_alls(
	

r2cKst|g|d||S)zr
    Serialize a Python object into a YAML stream.
    If stream is None, return the produced string instead.
    r)r2)r1rrr-rrr	dumpsr3cKst||dt|S)z
    Serialize a sequence of Python objects into a YAML stream.
    Produce only basic YAML tags.
    If stream is None, return the produced string instead.
    r)r2
SafeDumper)r0rr-rrr	
safe_dump_allsr5cKst|g|dt|S)z
    Serialize a Python object into a YAML stream.
    Produce only basic YAML tags.
    If stream is None, return the produced string instead.
    r)r2r4)r1rr-rrr		safe_dumpsr6cCs*|j||||j|||dS)z
    Add an implicit scalar detector.
    If an implicit scalar value matches the given regexp,
    the corresponding tag is assigned to the scalar.
    first is a sequence of possible initial characters or None.
    N)add_implicit_resolver)tagZregexpfirstrrrrr	r7sr7cCs*|j||||j|||dS)z
    Add a path based resolver for the given tag.
    A path is a list of keys that forms a path
    to a node in the representation tree.
    Keys can be string values, integers, or None.
    N)add_path_resolver)r8pathkindrrrrr	r:sr:cCs|j||dS)z
    Add a constructor for the given tag.
    Constructor is a function that accepts a Loader instance
    and a node object and produces the corresponding Python object.
    N)add_constructor)r8constructorrrrr	r=sr=cCs|j||dS)a
    Add a multi-constructor for the given tag prefix.
    Multi-constructor is called for a node if its tag starts with tag_prefix.
    Multi-constructor accepts a Loader instance, a tag suffix,
    and a node object and produces the corresponding Python object.
    N)add_multi_constructor)Z
tag_prefixZmulti_constructorrrrr	r?sr?cCs|j||dS)z
    Add a representer for the given type.
    Representer is a function accepting a Dumper instance
    and an instance of the given data type
    and producing the corresponding representation node.
    N)add_representer)	data_typeZrepresenterrrrr	r@sr@cCs|j||dS)z
    Add a representer for the given type.
    Multi-representer is a function accepting a Dumper instance
    and an instance of the given data type or subtype
    and producing the corresponding representation node.
    N)add_multi_representer)rAZmulti_representerrrrr	rB	srBcs(eZdZdZfddZS)YAMLObjectMetaclassz'
    The metaclass for YAMLObject.
    csktt|j|||d|krg|ddk	rg|jj|j|j|jj||j	dS)Nyaml_tag)
superrC__init__yaml_loaderr=rD	from_yamlyaml_dumperr@to_yaml)clsnamebasesr-)	__class__rr	rFszYAMLObjectMetaclass.__init__)__name__
__module____qualname____doc__rFrr)rNr	rCsrCc@sXeZdZdZfZeZeZdZ	dZ
eddZeddZ
dS)
YAMLObjectza
    An object that can dump itself to a YAML stream
    and load itself from a YAML stream.
    NcCs|j||S)zC
        Convert a representation node to a Python object.
        )Zconstruct_yaml_object)rKrr+rrr	rH*szYAMLObject.from_yamlcCs|j|j||d|jS)zC
        Convert a Python object to a representation node.
        Z
flow_style)Zrepresent_yaml_objectrDyaml_flow_style)rKrr1rrr	rJ1szYAMLObject.to_yaml)rOrPrQrR	__slots__rrGrrIrDrTclassmethodrHrJrrrr	rSsrS	metaclass)%errortokensrr*rr__version__ZcyamlZ__with_libyaml__ImportErrorrrr
rrr
rrrrrrr,r(r2r3r5r6r7r:r=r?r@rBtyperCrSrrrr	<module>s^








					

			
Back to Directory File Manager