/[theodore]/bunnyblog/modules/yaml/constructor.pyc


UCC Code Repository

Contents of /bunnyblog/modules/yaml/constructor.pyc

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1 - (show annotations) (download) (as text)
Tue Jan 29 14:32:01 2008 UTC (12 years, 2 months ago) by svn-admin
File MIME type: application/octet-stream
File size: 20476 byte(s)
Re-import of repository after repository database corruption.

1
2 ºŽ<Fc@sûddddgZdkTdkTdkZyeWn ej
3 odklZnXdkZdk Z dk
4 Z
5 dk Z de fd„ƒYZ defd„ƒYZdefd „ƒYZeid
6 eiƒeid eiƒeid eiƒeid eiƒeideiƒeideiƒeideiƒeideiƒeideiƒeideiƒeideiƒeideiƒeideiƒdefd„ƒYZ e ide iƒe ide iƒe ide i!ƒe ide i"ƒe ide iƒe ide i#ƒe ide iƒe ide i$ƒe ide iƒe id e i%ƒe id!e iƒe i&d"e i'ƒe i&d#e i(ƒe i&d$e i)ƒe i&d%e i*ƒe i&d&e i+ƒdS('tBaseConstructortSafeConstructort ConstructortConstructorError(t*N(sSetcBstZRS(N(t__name__t
7 __module__(((t./modules/yaml/constructor.pyRscBs›tZhZhZd„Zd„Zd„Zd„Zed„Z d„Z
8 ed„Z ed„Z ed „Z d
9 „ZeeƒZd „ZeeƒZRS( NcCs(h|_h|_g|_t|_dS(N(tselftconstructed_objectstrecursive_objectststate_generatorstFalsetdeep_construct(R((Rt__init__s   cCs
10 |iƒS(N(Rt
11 check_node(R((Rt
12 check_datascCs(|iƒo|i|iƒƒSndS(N(RRtconstruct_documenttget_node(R((Rtget_data#s cCst|i|ƒ}xC|io8|i}g|_x|D]}x|D]}qBWq5WqWh|_h|_t |_
13 |S(N( Rtconstruct_objecttnodetdataR t generatortdummyR R
14 R R (RRR RRR((RR(s
15       c Cs^|o|i} t|_n||ijo|i|Sn||ijotddd|i
16 ƒ‚nd|i|<d}
17 d}d}|i|ijo|i|i}
18 nøxô|iD]>}|ii|ƒo%|it|ƒ}|i|}
19 Pq¸q¸Wd|ijo|i}|id}
20 n‚d|ijo|id}
21 nat|tƒo|ii}
22 nAt|tƒo|ii}
23 n!t|tƒo|ii}
24 n|djo|
25 ||ƒ}n|
26 |||ƒ}t|tiƒoE|}|i ƒ}|iox"|D]}q Wq/|i"i#|ƒn||i|<|i|=|o | |_n|S(Ns$found unconstructable recursive node($tdeepRR told_deeptTrueRR R
27 RtNonet
28 start_markt constructortstate_constructort
29 tag_suffixttagtyaml_constructorstyaml_multi_constructorst
30 tag_prefixt
31 startswithtlent
32 isinstancet
33 ScalarNodet __class__tconstruct_scalart SequenceNodetconstruct_sequencet MappingNodetconstruct_mappingRttypest GeneratorTypeRtnextRR tappend( RRRRR RRRR$RR((RR5s^    
34      
35  
36  cCs:t|tƒp#tddd|i|iƒ‚n|iS(Ns$expected a scalar node, but found %s(R'RR(RRtidRtvalue(RR((RR*hs
37  
38 cCsdt|tƒp#tddd|i|iƒ‚ng}|iD]}||i |d|ƒqA~S(Ns&expected a sequence node, but found %sR( R'RR+RRR3Rt_[1]R4tchildRRR(RRRR5R6((RR,os
39  
40 c CsÐt|tƒp#tddd|i|iƒ‚nh}x|iD]…\}}|i |d|ƒ}yt|ƒWn4tj
41 o(}td|id||iƒ‚nX|i |d|ƒ}|||<qCW|S(Ns%expected a mapping node, but found %sRswhile constructing a mappingsfound unacceptable key (%s)(R'RR-RRR3RtmappingR4tkey_nodet
42 value_nodeRRRtkeythasht TypeErrortexc( RRRR8R7R:R4R9R=((RR.ws  
43 
44  cCs”t|tƒp#tddd|i|iƒ‚ng}xT|iD]I\}}|i |d|ƒ}|i |d|ƒ}|i||fƒqCW|S(Ns%expected a mapping node, but found %sR(R'RR-RRR3RtpairsR4R8R9RRRR:R2(RRRR8R>R:R4R9((Rtconstruct_pairsˆs 
45 
46 cCs7d|ijo|iiƒ|_n||i|<dS(NR"(tclst__dict__R"tcopyRR!(R@R!R((Rtadd_constructor”scCs7d|ijo|iiƒ|_n||i|<dS(NR#(R@RAR#RBtmulti_constructorR$(R@R$RD((Rtadd_multi_constructoršs(RRR"R#RRRRR RR*R,R.R?RCt classmethodRE(((RRs    3      cBs)tZd„Zd„Zed„Zd„Zhde<de<de<de<d e<d
47 e<Zd „Z d „Z
48 d Z x e e e joe e 9Z q„We e Z d„Z d„ZeideiƒZd„Zd„Zd„Zd„Zd„Zd„Zd„Zd„Zd„ZRS(NcCs_t|tƒo?x<|iD]-\}}|idjo|i|ƒSqqWnt i||ƒS(Nutag:yaml.org,2002:value(
49 R'RR-R4R8R9R!RR*R(RRR8R9((RR*¢s 
50 c Cs§g}d}xy|t|iƒjob|i|\}}|idjo
51 |i|=t|t ƒo!|i |ƒ|i |iƒqƒt|t ƒo™g}xd|iD]Y}t|t ƒp&td|id|i|iƒ‚n|i |ƒ|i|iƒq£W|iƒxA|D]}|i |ƒqWqƒtd|id|i|iƒ‚q|idjod|_|d7}q|d7}qW|o||i|_ndS( Niutag:yaml.org,2002:mergeswhile constructing a mappings,expected a mapping for merging, but found %ss@expected a mapping or list of mappings for merging, but found %sutag:yaml.org,2002:valueutag:yaml.org,2002:stri(tmergetindexR&RR4R8R9R!R'R-Rtflatten_mappingtextendR+tsubmergetsubnodeRRR3R2treverse( RRRHR8RGR4RKR9RL((RRI©sD
52  
53 
54  
55  
56  cCs7t|tƒo|i|ƒnti||d|ƒS(NR(R'RR-RRIRR.R(RRR((RR.ÌscCs|i|ƒdS(N(RR*RR(RR((Rtconstruct_yaml_nullÑs uyesunoutrueufalseuonuoffcCs |i|ƒ}|i|iƒS(N(RR*RR4t bool_valuestlower(RRR4((Rtconstruct_yaml_boolÞsc CsŽt|i|ƒƒ}|iddƒ}d}|ddjo
57 d}n|ddjo|d}n|djodSn|id ƒo|t|d
58 d
59 ƒSnæ|id ƒo|t|d
60 d ƒSn½|ddjo|t|d ƒSn—d|jo{g}|i
61 dƒD]}|t|ƒq~}|i ƒd}d}x&|D]}|||7}|d9}qNW||Sn|t|ƒSdS(Nt_tiit-iÿÿÿÿs+-t0t0bit0xiit:i<(tstrRR*RR4treplacetsignR%tintR5tsplittparttdigitsRMtbasetdigit( RRR_RaR4R[R5R^R`((Rtconstruct_yaml_intâs4
62   0
63  f1.0000000000000001e+300c Cs;t|i|ƒƒ}|iddƒiƒ}d}|ddjo
64 d}n|ddjo|d}n|djo||iSn¯|d jo |i Sn—d
65 |jo{g}|i d
66 ƒD]}|t |ƒqÂ~}|iƒd}d }x&|D]}|||7}|d 9}qûW||Sn|t |ƒSdS( NRRRSiiRTiÿÿÿÿs+-s.infs.nanRXf0.0i<(RYRR*RR4RZRPR[t inf_valuet nan_valueR5R]R^tfloatR_RMR`Ra( RRR_RaR4R[R5R^R`((Rtconstruct_yaml_floats,
67     0
68  cCsg|i|ƒ}yt|ƒidƒSWn:titfj
69 o%}t
70 ddd||i ƒ‚nXdS(Ntbase64s failed to decode base64 data: %s( RR*RR4RYtdecodetbinasciitErrortUnicodeEncodeErrorR=RRR(RRR=R4((Rtconstruct_yaml_binarys  u´^(?P<year>[0-9][0-9][0-9][0-9])
71 -(?P<month>[0-9][0-9]?)
72 -(?P<day>[0-9][0-9]?)
73 (?:(?:[Tt]|[ \t]+)
74 (?P<hour>[0-9][0-9]?)
75 :(?P<minute>[0-9][0-9])
76 :(?P<second>[0-9][0-9])
77 (?:\.(?P<fraction>[0-9]*))?
78 (?:[ \t]*(?P<tz>Z|(?P<tz_sign>[-+])(?P<tz_hour>[0-9][0-9]?)
79 (?::(?P<tz_minute>[0-9][0-9]))?))?)?$cCs‘|i|ƒ}|ii|iƒ}|iƒ}t|dƒ} t|dƒ}t|dƒ}|dpt i | ||ƒSnt|dƒ}t|dƒ} t|dƒ}d}
80 |do$t|dd id d
81 ƒƒ}
82 nd}|d o_t|d ƒ}t|d pdƒ} t id|d| ƒ}|d djo | }qWnt i | |||| ||
83 ƒ} |o| |8} n| S(NtyeartmonthtdaythourtminutetseconditfractioniRUttz_signttz_hourt tz_minutethourstminutesRT(RR*RR4ttimestamp_regexptmatcht groupdicttvaluesR\RmRnRotdatetimetdateRpRqRrRstljustRtdeltaRuRvt timedeltaR(RRRpR€RuR4RnRrR|RqRsRmRvRRoRz((Rtconstruct_yaml_timestamp/s2   $ !ccsg}|Vt|tƒp&td|id|i|iƒ‚nxÍ|iD]Â}t|t ƒp&td|id|i|iƒ‚nt
84 |iƒdjo,td|idt
85 |iƒ|iƒ‚n|id\}}|i|ƒ}|i|ƒ}|i||fƒqJWdS(Ns!while constructing an ordered maps!expected a sequence, but found %ss,expected a mapping of length 1, but found %sis2expected a single mapping item, but found %d itemsi(tomapR'RR+RRR3R4RLR-R&R8R9RRR:R2(RRR8R:R4RƒR9RL((Rtconstruct_yaml_omapJs& 
86  
87  ccsg}|Vt|tƒp&td|id|i|iƒ‚nxÍ|iD]Â}t|t ƒp&td|id|i|iƒ‚nt
88 |iƒdjo,td|idt
89 |iƒ|iƒ‚n|id\}}|i|ƒ}|i|ƒ}|i||fƒqJWdS(Nswhile constructing pairss!expected a sequence, but found %ss,expected a mapping of length 1, but found %sis2expected a single mapping item, but found %d itemsi(R>R'RR+RRR3R4RLR-R&R8R9RRR:R2(RRR>R8R:R4R9RL((Rtconstruct_yaml_pairs`s& 
90  
91  ccs-tƒ}|V|i|ƒ}|i|ƒdS(N(tsetRRR.RR4tupdate(RRRR4((Rtconstruct_yaml_setus cCs>|i|ƒ}y|idƒSWntj
92 o |SnXdS(Ntascii(RR*RR4tencodeRk(RRR4((Rtconstruct_yaml_str{s
93 ccs$g}|V|i|i|ƒƒdS(N(RRJRR,R(RRR((Rtconstruct_yaml_seq‚sccs*h}|V|i|ƒ}|i|ƒdS(N(RRR.RR4R‡(RRRR4((Rtconstruct_yaml_map‡sccsl|i|ƒ}|Vt|dƒo&|i|dtƒ}|i |ƒn |i|ƒ}|i
94 i |ƒdS(Nt __setstate__R( R@t__new__RthasattrRR.RRtstateRŽRAR‡(RRR@R‘R((Rtconstruct_yaml_objectscCs,tddd|iidƒ|iƒ‚dS(Ns0could not determine a constructor for the tag %rsutf-8(RRRR!RŠR(RR((Rtconstruct_undefined—s (RRR*RIR R.RNRRORQRbRcRdRfRltretcompiletXRyR‚R„R…RˆR‹RŒRR’R“(((RR s0  #  <            
95 utag:yaml.org,2002:nullutag:yaml.org,2002:boolutag:yaml.org,2002:intutag:yaml.org,2002:floatutag:yaml.org,2002:binaryutag:yaml.org,2002:timestamputag:yaml.org,2002:omaputag:yaml.org,2002:pairsutag:yaml.org,2002:setutag:yaml.org,2002:strutag:yaml.org,2002:sequtag:yaml.org,2002:mapcBs¥tZd„Zd„Zd„Zd„Zd„Zd„Zd„Zd„Z d „Z
96 d
97 fd „ƒYZ dde d „Zd „Zd„Ze d„Zd„ZRS(NcCs|i|ƒidƒS(Nsutf-8(RR*RRŠ(RR((Rtconstruct_python_strÑscCs |i|ƒS(N(RR*R(RR((Rtconstruct_python_unicodeÔscCst|i|ƒƒS(N(tlongRRbR(RR((Rtconstruct_python_long×scCst|i|ƒƒS(N(tcomplexRR*R(RR((Rtconstruct_python_complexÚscCst|i|ƒƒS(N(ttupleRR,R(RR((Rtconstruct_python_tupleÝscCsy|ptd|d|ƒ‚nyt|ƒWn=tj
98 o1}td|d|idƒ|f|ƒ‚nXti|S(Ns"while constructing a Python modules+expected non-empty name appended to the tagscannot find module %r (%s)sutf-8( tnameRtmarkt
99 __import__t ImportErrorR=RŠtsystmodules(RRŸR R=((Rtfind_python_moduleàs  $cCs|ptd|d|ƒ‚nd|jo.|idƒ}|iƒ}di|ƒ}n d}|}yt |ƒWn=t
100 j
101 o1}td|d|i dƒ|f|ƒ‚nXt i|}t||ƒp/td|d|i dƒ|if|ƒ‚nt||ƒS( Ns"while constructing a Python objects+expected non-empty name appended to the tagu.t.t __builtin__scannot find module %r (%s)sutf-8scannot find %r in the module %r(RŸRR R]titemstpopt object_nametjoint module_nameR¡R¢R=RŠR£R¤tmoduleRRtgetattr(RRŸR R¨R­RªR¬R=((Rtfind_python_nameës(    $   cCsU|i|ƒ}|o,td|id|idƒ|iƒ‚n|i||iƒS(Ns while constructing a Python names&expected the empty value, but found %rsutf-8( RR*RR4RRRŠR¯tsuffix(RR°RR4((Rtconstruct_python_names  cCsU|i|ƒ}|o,td|id|idƒ|iƒ‚n|i||iƒS(Ns"while constructing a Python modules&expected the empty value, but found %rsutf-8( RR*RR4RRRŠR¥R°(RR°RR4((Rtconstruct_python_module s  tclassobjcBstZRS(N(RR(((RR³scCsÃ|p
102 g}n|p
103 h}n|i||iƒ}|oFt |t
104 |i ƒƒo-| o%| o|i ƒ}||_ |Sn<|o't |t
105 ƒo|i|||ŽSn|||ŽSdS(N(targstkwdsRR¯R°RRR@tnewobjR'ttypeR³tinstanceR)R(RR°RR´RµR¶R¸R@((Rtmake_python_instances
106 
107 0  cCsÇt|dƒo|i|ƒn£h}t|tƒo#t|ƒdjo|\}}nt|dƒo|ii |ƒn|o|i |ƒnx*|i
108 ƒD]\}}t t||ƒq£WdS(NRŽiRA(RR¸RŽR‘t slotstateR'RR&RAR‡R¨R:R4tsetattrtobject(RR¸R‘RºR4R:((Rtset_python_instance_state's# ccsT|i||dtƒ}|Vt|dƒ}|i|d|ƒ}|i
109 ||ƒdS(NR¶RŽR( RR¹R°RRR¸RRR.R‘R½(RR°RRR¸R‘((Rtconstruct_python_object5s
110 c Cs,t|tƒo1|i|dtƒ}h} h}g}h} np|i |dtƒ}|i dgƒ}|i dhƒ} |i dhƒ}|i dgƒ}|i dhƒ} |i|||| |ƒ}|o|i||ƒn|o|i|ƒn| o#x | D]}
111 | |
112 ||
113 <q Wn|S(NRR´RµR‘t listitemst dictitems(R'RR+RR,RR´RµR‘R¿RÀR.R4tgetR¹R°R¶R¸R½RJR:( RR°RR¶R´R¿R4R¸R‘RÀR:Rµ((Rtconstruct_python_object_apply>s, 
114 cCs|i||dtƒS(NR¶(RRÂR°RR(RR°R((Rtconstruct_python_object_newas(RRR—R˜RšRœRžR¥R¯R±R²R³RR R¹R½R¾RÂRÃ(((RRÏs          #utag:yaml.org,2002:python/noneutag:yaml.org,2002:python/boolutag:yaml.org,2002:python/stru tag:yaml.org,2002:python/unicodeutag:yaml.org,2002:python/intutag:yaml.org,2002:python/longutag:yaml.org,2002:python/floatu tag:yaml.org,2002:python/complexutag:yaml.org,2002:python/listutag:yaml.org,2002:python/tupleutag:yaml.org,2002:python/dictutag:yaml.org,2002:python/name:u tag:yaml.org,2002:python/module:u tag:yaml.org,2002:python/object:u&tag:yaml.org,2002:python/object/apply:u$tag:yaml.org,2002:python/object/new:(,t__all__terrortnodesR}R†t NameErrortsetstSetRiR”R£R/tMarkedYAMLErrorRR¼RRRCRNRQRbRfRlR‚R„R…RˆR‹RŒRRR“RR—R˜RšRœRžRER±R²R¾RÂRÃ( R£RR†RÄRiR}R”RRRR/((Rt?sŒ $Œü 
115  
116  
117  
118  
119  
120  
121  
122  
123  
124  
125  
126  
127 • 
128  
129  
130  
131  
132  
133  
134  
135  
136  
137  
138  
139  
140  
141  
142  

Properties

Name Value
svn:mime-type application/octet-stream

Managed by UCC Webmasters ViewVC Help
Powered by ViewVC 1.1.26