MOON
Server: Apache/2.2.34 (Unix) mod_ssl/2.2.34 OpenSSL/0.9.8e-fips-rhel5 mod_bwlimited/1.4 FrontPage/5.0.2.2635
System: Linux server.asjudinet.com 2.6.32-042stab141.3 #1 SMP Fri Nov 15 22:45:34 MSK 2019 i686
User: asjudine (504)
PHP: 5.2.17
Disabled: NONE
Upload Files
File: //proc/2/task/2/root/usr/lib/python2.4/Demo/parser/example.pyo
mň
‚=5Dc@s¨dZdkZdkZdkZdkZdkZdklZlZd„Zdfd„ƒYZ	dfd„ƒYZ
de	e
fd	„ƒYZd
e	fd„ƒYZde	e
fd
„ƒYZ
dd„ZeieidgffZeieieieieieieieieieieieieieiei ei!ei"ei#ei$dgfffffffffffffffffei%dfffZ&dS(süSimple code to extract class & function docstrings from a module.

This code is used as an example in the library reference manual in the
section on using the parser module.  Refer to the manual for a thorough
discussion of the operation of this code.
N(sListTypes	TupleTypecCsVt|ƒiƒ}tiitii|ƒdƒ}ti	|ƒ}t|iƒ|ƒS(s‡Retrieve information from the parse tree of a source file.

    fileName
        Name of the file to read Python source code from.
    iN(
topentfileNametreadtsourcetostpathtbasenametsplitexttparsertsuitetastt
ModuleInfottotuple(RR
RR((t)/usr/lib/python2.4/Demo/parser/example.pytget_docss
"t
SuiteInfoBasecBsVtZdZdZdd„Zd„Zd„Zd„Zd„Z	d„Z
d„ZRS(	NtcCs.h|_h|_|o|i|ƒndS(N(tselft_class_infot_function_infottreet
_extract_info(RR((R
t__init__!s		cCs t|ƒdjo!ttd|dƒ\}}ntt|dƒ\}}|ot|dƒ|_nxŽ|dD]˘}tt
|ƒ\}}|o€|d}|dti
jo%|dd}t|ƒ|i|<q|dtijo%|dd}t|ƒ|i|<qqvqvWdS(Niiit	docstringtcompoundi(tlenRtmatchtDOCSTRING_STMT_PATTERNtfoundtvarstevalRt
_docstringtnodetCOMPOUND_STMT_PATTERNtcstmttsymboltfuncdeftnametFunctionInfoRtclassdeft	ClassInfoR(RRR R%RR"R((R
R's !
cCs|iS(N(RR(R((R
t
get_docstring;scCs|iS(N(Rt_name(R((R
tget_name>scCs
|iiƒS(N(RRtkeys(R((R
tget_class_namesAscCs|i|S(N(RRR%(RR%((R
tget_class_infoDscCs4y|i|SWntj
o|i|SnXdS(N(RRR%tKeyErrorR(RR%((R
t__getitem__Gs(t__name__t
__module__RR*tNoneRRR)R+R-R.R0(((R
Rs					t
SuiteFuncInfocBstZd„Zd„ZRS(NcCs
|iiƒS(N(RRR,(R((R
tget_function_namesQscCs|i|S(N(RRR%(RR%((R
tget_function_infoTs(R1R2R5R6(((R
R4Ns	R&cBstZdd„ZRS(NcCs7|dd|_ti||o|dpdƒdS(Niii˙˙˙˙(RRR*RRR3(RR((R
RYs(R1R2R3R(((R
R&XsR(cBs&tZdd„Zd„Zd„ZRS(NcCs7|dd|_ti||o|dpdƒdS(Niii˙˙˙˙(RRR*RRR3(RR((R
R_scCs
|iiƒS(N(RRR,(R((R
tget_method_namescscCs|i|S(N(RRR%(RR%((R
tget_method_infofs(R1R2R3RR7R8(((R
R(^s	RcBstZddd„ZRS(Ns<string>cCsY||_ti||ƒ|o5tt|dƒ\}}|o|d|_
qUndS(NiR(R%RR*RRRRRRRR(RRR%RR((R
Rks	(R1R2R3R(((R
RjscCsĺ|djo
h}nt|ƒtjo|||d<d|fSnt|ƒtj	o||j|fSnt|ƒt|ƒjod|fSnxDtd||ƒD]0\}}t	|||ƒ\}}|pPq§q§W||fS(saMatch `data' to `pattern', with variable extraction.

    pattern
        Pattern to match against, possibly containing variables.

    data
        Data to be checked and against which variables are extracted.

    vars
        Dictionary of variables which have already been found.  If not
        provided, an empty dictionary is created.

    The `pattern' value may contain variables of the form ['varname'] which
    are allowed to match anything.  The value that is matched is returned as
    part of a dictionary which maps 'varname' to the matched value.  'varname'
    is not required to be a string object, but using strings makes patterns
    and the code which uses them more readable.

    This function returns two values: a boolean indicating whether a match
    was found and a dictionary mapping variable names to their associated
    values.
    iiN(RR3ttypetpatterntListTypetdatat	TupleTypeRtmapRtsame(R:R<RR?((R
Rts 

	RRR('t__doc__RRR#ttokenttypesR;R=RRR4R&R(RR3Rtstmtt
compound_stmtR!tsimple_stmtt
small_stmtt	expr_stmtttestlistttesttand_testtnot_testt
comparisontexprtxor_exprtand_exprt
shift_exprt
arith_exprttermtfactortpowertatomtSTRINGtNEWLINER(R4R(R#RRR!R&RARRR;RR=RRBR((R
t?s						1

*