• File: constructor.cpython-37.pyc
  • Full Path: /home3/farmfre2/public_html/ALFA_DATA/alfasymlink/root/opt/alt/python37/lib64/python3.7/site-packages/yaml/__pycache__/constructor.cpython-37.pyc
  • Date Modified: 07/08/2021 12:13 AM
  • File size: 18.36 KB
  • MIME-type: text/x-bytecode.python
  • Charset: 8 bit
B

5[c@s:ddddgZddlTddlTddlZddlZddlZddlZddlZddlZddl	Z	Gddde
ZGd	ddZGd
ddeZ
e
de
je
de
je
d
e
je
de
je
de
je
de
je
de
je
de
je
de
je
de
je
de
je
de
je
de
jGddde
Zedejedejedejedejedejedejedej edejed ej!ed!ejed"ej"ed#eje#d$ej$e#d%ej%e#d&ej&e#d'ej'e#d(ej(dS))BaseConstructorSafeConstructorConstructorConstructorError)*Nc@seZdZdS)rN)__name__
__module____qualname__rrC/opt/alt/python37/lib64/python3.7/site-packages/yaml/constructor.pyr
sc@seZdZiZiZddZddZddZddZd	d
Z	ddd
Z
ddZdddZdddZ
dddZeddZeddZdS)rcCsi|_i|_g|_d|_dS)NF)constructed_objectsrecursive_objectsstate_generatorsdeep_construct)selfrrr__init__szBaseConstructor.__init__cCs|S)N)
check_node)rrrr
check_dataszBaseConstructor.check_datacCs|r||SdS)N)rconstruct_documentZget_node)rrrrget_dataszBaseConstructor.get_datacCs|}|dk	r||SdS)N)Zget_single_noder)rnoderrrget_single_data!s
zBaseConstructor.get_single_datacCsT||}x2|jr<|j}g|_x|D]}x|D]}q.Wq$WqWi|_i|_d|_|S)NF)construct_objectrr
rr)rrdatar	generatordummyrrrr(s


z"BaseConstructor.construct_documentFc
Cs||jkr|j|S|r$|j}d|_||jkr>tddd|jd|j|<d}d}|j|jkrj|j|j}nx|jD].}|j|rr|jt	|d}|j|}PqrWd|jkr|j}|jd}nRd|jkr|jd}n<t
|tr|jj
}n(t
|tr|jj}nt
|tr|jj}|dkr(|||}n||||}t
|tjrt|}t|}|jrhx|D]}	q\Wn|j|||j|<|j|=|r||_|S)NTz$found unconstructable recursive node)r
rrr
start_marktagyaml_constructorsyaml_multi_constructors
startswithlen
isinstance
ScalarNode	__class__construct_scalarSequenceNodeconstruct_sequenceMappingNodeconstruct_mappingtypes
GeneratorTypenextrappend)
rrdeepZold_deepconstructorZ
tag_suffix
tag_prefixrrrrrrr5sX














z BaseConstructor.construct_objectcCs&t|ts tddd|j|j|jS)Nz$expected a scalar node, but found %s)r#r$ridrvalue)rrrrrr&gs

z BaseConstructor.construct_scalarcs6t|ts tddd|j|jfdd|jDS)Nz&expected a sequence node, but found %scsg|]}j|dqS))r/)r).0Zchild)r/rrr
<listcomp>ssz6BaseConstructor.construct_sequence.<locals>.<listcomp>)r#r'rr2rr3)rrr/r)r/rrr(ns
z"BaseConstructor.construct_sequencecCs~t|ts tddd|j|ji}xT|jD]J\}}|j||d}t|tjs`td|jd|j|j||d}|||<q,W|S)Nz%expected a mapping node, but found %s)r/zwhile constructing a mappingzfound unhashable key)	r#r)rr2rr3rcollectionsHashable)rrr/mappingkey_node
value_nodekeyr3rrrr*vs

z!BaseConstructor.construct_mappingcCsft|ts tddd|j|jg}x<|jD]2\}}|j||d}|j||d}|||fq,W|S)Nz%expected a mapping node, but found %s)r/)r#r)rr2rr3rr.)rrr/pairsr9r:r;r3rrrconstruct_pairss
zBaseConstructor.construct_pairscCs$d|jkr|j|_||j|<dS)Nr)__dict__rcopy)clsrr0rrradd_constructors
zBaseConstructor.add_constructorcCs$d|jkr|j|_||j|<dS)Nr )r>r r?)r@r1Zmulti_constructorrrradd_multi_constructors
z%BaseConstructor.add_multi_constructorN)F)F)F)F)rr	r
rr rrrrrrr&r(r*r=classmethodrArBrrrrr
s
2


cseZdZfddZddZd(fdd	Zdd	Zd
dd
dd
ddZdd
ZddZ	dZ
xe
e
e
krpe
e
9Z
qZWe
e
ZddZddZ
edejZddZddZddZddZddZd d!Zd"d#Zd$d%Zd&d'ZZS))rcs>t|tr2x&|jD]\}}|jdkr||SqWt|S)Nztag:yaml.org,2002:value)r#r)r3rr&super)rrr9r:)r%rrr&s


z SafeConstructor.construct_scalarc	Cs.g}d}x|t|jkr|j|\}}|jdkr|j|=t|tr^||||jnt|trg}xF|jD]<}t|tstd|j	d|j
|j	||||jqtW|x0|D]}||qWntd|j	d|j
|j	q|jdkrd|_|d7}q|d7}qW|r*||j|_dS)	Nrztag:yaml.org,2002:mergezwhile constructing a mappingz,expected a mapping for merging, but found %sz@expected a mapping or list of mappings for merging, but found %sztag:yaml.org,2002:valueztag:yaml.org,2002:strr)
r"r3rr#r)flatten_mappingextendr'rrr2r.reverse)	rrmergeindexr9r:Zsubmergesubnoder3rrrrEs>







zSafeConstructor.flatten_mappingFcs$t|tr||tj||dS)N)r/)r#r)rErDr*)rrr/)r%rrr*s

z!SafeConstructor.construct_mappingcCs||dS)N)r&)rrrrrconstruct_yaml_nulls
z#SafeConstructor.construct_yaml_nullT)ZyesZnotrueZfalseZonZoffcCs||}|j|S)N)r&bool_valueslower)rrr3rrrconstruct_yaml_bools
z#SafeConstructor.construct_yaml_boolcCs||}|dd}d}|ddkr*d}|ddkrB|dd}|dkrNdS|d	rn|t|d
dd
S|dr|t|d
ddS|ddkr|t|d
Sd|krdd|dD}|d}d}x |D]}|||7}|d9}qW||S|t|SdS)N_rr-z+-0Z0bZ0x:cSsg|]}t|qSr)int)r4partrrrr5sz6SafeConstructor.construct_yaml_int.<locals>.<listcomp><)r&replacer!rYsplitrG)rrr3signdigitsbasedigitrrrconstruct_yaml_ints2




z"SafeConstructor.construct_yaml_intgu<7~cCs||}|dd}d}|ddkr.d}|ddkrF|dd}|dkrX||jS|d	krf|jSd
|krdd|d
D}|d}d
}x |D]}|||7}|d9}qW||S|t|SdS)NrPrQrrrRrSz+-z.infz.nanrXcSsg|]}t|qSr)float)r4rZrrrr5
sz8SafeConstructor.construct_yaml_float.<locals>.<listcomp>gr[)r&r\rN	inf_value	nan_valuer]rGrc)rrr3r^r_r`rarrrconstruct_yaml_floats*


z$SafeConstructor.construct_yaml_floatc
Csy||d}Wn6tk
rJ}ztddd||jWdd}~XYnXy"ttdrbt|St|SWn8t	j
k
r}ztddd||jWdd}~XYnXdS)Nasciiz,failed to convert base64 data into ascii: %sdecodebytesz failed to decode base64 data: %s)r&encodeUnicodeEncodeErrorrrhasattrbase64rhdecodestringbinasciiError)rrr3excrrrconstruct_yaml_binarys

z%SafeConstructor.construct_yaml_binarya^(?P<year>[0-9][0-9][0-9][0-9])
                -(?P<month>[0-9][0-9]?)
                -(?P<day>[0-9][0-9]?)
                (?:(?:[Tt]|[ \t]+)
                (?P<hour>[0-9][0-9]?)
                :(?P<minute>[0-9][0-9])
                :(?P<second>[0-9][0-9])
                (?:\.(?P<fraction>[0-9]*))?
                (?:[ \t]*(?P<tz>Z|(?P<tz_sign>[-+])(?P<tz_hour>[0-9][0-9]?)
                (?::(?P<tz_minute>[0-9][0-9]))?))?)?$c	Cs0||}|j|j}|}t|d}t|d}t|d}|dsZt|||St|d}t|d}	t|d}
d}|dr|ddd	}xt|d	kr|d
7}qWt|}d}|drt|d}
t|d
pd}tj	|
|d}|ddkr|}t|||||	|
|}|r,||8}|S)NyearmonthdayhourminutesecondrfractionrTZtz_signtz_hour	tz_minute)ZhoursZminutesrR)
r&timestamp_regexpmatchr3	groupdictrYdatetimeZdater"Z	timedelta)rrr3r}valuesrrrsrtrurvrwrxZdeltarzr{rrrrconstruct_yaml_timestamp4s8

z(SafeConstructor.construct_yaml_timestampccsg}|Vt|ts,td|jd|j|jx|jD]}t|tsZtd|jd|j|jt|jdkrtd|jdt|j|j|jd\}}||}||}|	||fq4WdS)Nz!while constructing an ordered mapz!expected a sequence, but found %sz,expected a mapping of length 1, but found %srz2expected a single mapping item, but found %d itemsr)
r#r'rrr2r3r)r"rr.)rrZomaprJr9r:r;r3rrrconstruct_yaml_omapRs$



z#SafeConstructor.construct_yaml_omapccsg}|Vt|ts,td|jd|j|jx|jD]}t|tsZtd|jd|j|jt|jdkrtd|jdt|j|j|jd\}}||}||}|	||fq4WdS)Nzwhile constructing pairsz!expected a sequence, but found %sz,expected a mapping of length 1, but found %srz2expected a single mapping item, but found %d itemsr)
r#r'rrr2r3r)r"rr.)rrr<rJr9r:r;r3rrrconstruct_yaml_pairshs$



z$SafeConstructor.construct_yaml_pairsccs$t}|V||}||dS)N)setr*update)rrrr3rrrconstruct_yaml_set}s
z"SafeConstructor.construct_yaml_setcCs
||S)N)r&)rrrrrconstruct_yaml_strsz"SafeConstructor.construct_yaml_strccsg}|V|||dS)N)rFr()rrrrrrconstruct_yaml_seqsz"SafeConstructor.construct_yaml_seqccs"i}|V||}||dS)N)r*r)rrrr3rrrconstruct_yaml_maps
z"SafeConstructor.construct_yaml_mapccsN||}|Vt|dr4|j|dd}||n||}|j|dS)N__setstate__T)r/)__new__rkr*rr>r)rrr@rstaterrrconstruct_yaml_objects


z%SafeConstructor.construct_yaml_objectcCstddd|j|jdS)Nz0could not determine a constructor for the tag %r)rrr)rrrrrconstruct_undefinedsz#SafeConstructor.construct_undefined)F)rr	r
r&rEr*rKrMrOrbrdrerfrqrecompileXr|rrrrrrrrr
__classcell__rr)r%rrs:#



ztag:yaml.org,2002:nullztag:yaml.org,2002:boolztag:yaml.org,2002:intztag:yaml.org,2002:floatztag:yaml.org,2002:binaryztag:yaml.org,2002:timestampztag:yaml.org,2002:omapztag:yaml.org,2002:pairsztag:yaml.org,2002:setztag:yaml.org,2002:strztag:yaml.org,2002:seqztag:yaml.org,2002:mapc@seZdZddZddZddZddZd	d
ZddZd
dZ	ddZ
ddZddZd!ddZ
ddZddZd"ddZdd ZdS)#rcCs
||S)N)r&)rrrrrconstruct_python_strsz Constructor.construct_python_strcCs
||S)N)r&)rrrrrconstruct_python_unicodesz$Constructor.construct_python_unicodec
Csy||d}Wn6tk
rJ}ztddd||jWdd}~XYnXy"ttdrbt|St|SWn8t	j
k
r}ztddd||jWdd}~XYnXdS)Nrgz,failed to convert base64 data into ascii: %srhz failed to decode base64 data: %s)r&rirjrrrkrlrhrmrnro)rrr3rprrrconstruct_python_bytess

z"Constructor.construct_python_bytescCs
||S)N)rb)rrrrrconstruct_python_longsz!Constructor.construct_python_longcCst||S)N)complexr&)rrrrrconstruct_python_complexsz$Constructor.construct_python_complexcCst||S)N)tupler()rrrrrconstruct_python_tuplesz"Constructor.construct_python_tuplec
Csb|std|d|yt|Wn8tk
rV}ztd|d||f|Wdd}~XYnXtj|S)Nz"while constructing a Python modulez+expected non-empty name appended to the tagzcannot find module %r (%s))r
__import__ImportErrorsysmodules)rnamemarkrprrrfind_python_modules"zConstructor.find_python_modulec
Cs|std|d|d|kr,|dd\}}nd}|}yt|Wn8tk
rx}ztd|d||f|Wdd}~XYnXtj|}t||std|d||jf|t||S)Nz"while constructing a Python objectz+expected non-empty name appended to the tag.rbuiltinszcannot find module %r (%s)zcannot find %r in the module %r)	rrsplitrrrrrkrgetattr)rrrZmodule_nameZobject_namerpmodulerrrfind_python_names$"

zConstructor.find_python_namecCs2||}|r$td|jd||j|||jS)Nz while constructing a Python namez&expected the empty value, but found %r)r&rrr)rsuffixrr3rrrconstruct_python_names

z!Constructor.construct_python_namecCs2||}|r$td|jd||j|||jS)Nz"while constructing a Python modulez&expected the empty value, but found %r)r&rrr)rrrr3rrrconstruct_python_modules

z#Constructor.construct_python_moduleNFcCsL|sg}|si}|||j}|r>t|tr>|j|f||S|||SdS)N)rrr#typer)rrrargskwdsnewobjr@rrrmake_python_instance"sz Constructor.make_python_instancecCst|dr||nji}t|tr8t|dkr8|\}}t|drP|j|n|r^||x |D]\}}tt	||qhWdS)NrrUr>)
rkrr#rr"r>ritemssetattrobject)rinstancerZ	slotstater;r3rrrset_python_instance_state.s


z%Constructor.set_python_instance_stateccs>|j||dd}|Vt|d}|j||d}|||dS)NT)rr)r/)rrkr*r)rrrrr/rrrrconstruct_python_object<s

z#Constructor.construct_python_objectcCst|tr*|j|dd}i}i}g}i}nJ|j|dd}	|	dg}|	di}|	di}|	dg}|	di}||||||}
|r||
||r|
||rx|D]}|||
|<qW|
S)NT)r/rrr	listitems	dictitems)r#r'r(r*getrrrF)rrrrrrrrrr3rr;rrrconstruct_python_object_applyEs*


z)Constructor.construct_python_object_applycCs|j||ddS)NT)r)r)rrrrrrconstruct_python_object_newhsz'Constructor.construct_python_object_new)NNF)F)rr	r
rrrrrrrrrrrrrrrrrrrrs
	
#ztag:yaml.org,2002:python/noneztag:yaml.org,2002:python/boolztag:yaml.org,2002:python/strz tag:yaml.org,2002:python/unicodeztag:yaml.org,2002:python/bytesztag:yaml.org,2002:python/intztag:yaml.org,2002:python/longztag:yaml.org,2002:python/floatz tag:yaml.org,2002:python/complexztag:yaml.org,2002:python/listztag:yaml.org,2002:python/tupleztag:yaml.org,2002:python/dictztag:yaml.org,2002:python/name:z tag:yaml.org,2002:python/module:z tag:yaml.org,2002:python/object:z&tag:yaml.org,2002:python/object/apply:z$tag:yaml.org,2002:python/object/new:))__all__errorZnodesr6rrlrnrrr+ZMarkedYAMLErrorrrrrArKrOrbrfrqrrrrrrrrrrrrrrrrBrrrrrrrrr<module>s8