mò Ÿ¼÷Cc @s_dZdkZdkZdkZdkZdkZdkZdkZdkZdkZdk Z dkZdk l Z dkl Z l Z lZlZlZlZlZlZd„Zee_deifd„ƒYZdefd„ƒYZd fd „ƒYZed joMd d dddddddg ZdgZededddeƒiƒndS(s@Pydoc sub-class for generating documentation for entire packagesN(sRepr(s expandtabssfindsjoinslowerssplitsstripsrfindsrstripc Cs¨ti|ƒ}t|ƒ} g}x€| D]x}||ijo|i|}n/yt ||ƒ}Wnt j o }q(nXt |ddƒ} | djo0x-|D]!}||ijo |} Pq£q£Wn| dj o!|| ijo| i|}nt ||ƒ}t|tƒo d}net|tƒo d}nKt|tƒo d}n1ti|ƒpti|ƒo d}nd}|i||| |fƒq(W|S(shReturn list of attribute-descriptor tuples. For each name in dir(cls), the return list contains a 4-tuple with these elements: 0. The name (a string). 1. The kind of attribute this is, one of these strings: 'class method' created via classmethod() 'static method' created via staticmethod() 'property' created via property() 'method' any other flavor of method 'data' not a method 2. The class which defined this attribute (a class). 3. The object as obtained directly from the defining class's __dict__, not via getattr. This is especially important for data attributes: C.data is just a data object, but C.__dict__['data'] may be a data descriptor with additional info, like a __doc__ string. Note: This version is patched to work with Zope Interface-bearing objects t __objclass__s static methods class methodtpropertytmethodtdataN(tinspecttgetmrotclstmrotdirtnamestresulttnamet__dict__tobjtgetattrtAttributeErrorterrtNonethomeclstbasetobj_via_getattrt isinstancet staticmethodtkindt classmethodRtismethodtismethoddescriptortappend( RR R RRRR RRRR ((t3/oldroot/var/pylive/simpleparse/doc/pydoc/pydoc2.pytclassify_class_attrssB        tDefaultFormattercBs,tZdddd„Zd„Zd„ZRS(Nc$Gs|i}t|dƒ}g}xJtt|ƒdƒD]2}|i dt ||d dƒ||fƒq5Wt ||ddƒ}d|}yUt i|ƒ}|}!tidjodk}|i|ƒ}!nd|!|f}"Wntj o d }"nXg}t|d ƒojt|iƒ}|d d d jo(|dd jot|d d!ƒ}n|i d|i|ƒƒnt|dƒo#|i |it|iƒƒƒn|o|dt |dƒ}n|i |ddd|"ƒ} t i"|t i#ƒ}gh}#}xmt i"|t i'ƒD]V\}} t i*| ƒp||jo-|#i || fƒd|||<|| |i;t|iVƒ|i=ƒ}| |iNd+dd|ƒ} nt|d,ƒo>|i;t|iWƒ|i=ƒ}| |iNd-dd|ƒ} n| S(.s/Produce HTML documentation for a module object.t.is5%siÿÿÿÿs)%stwin32Ns%ss (built-in)t __version__i t$s Revision: s version %st__date__s (%s)s, s#ffffffs#7799eesindex
t#s.html#s#-t __builtins__t__doc__s %ss

%s

t__path__icCs|\}}|i|ƒS(N(tkeytvaluetst modulelink(t.0R*R(R)((RtªstModuless#fffffs#aa55cccCs|\}}|S(N(R(R)(R,R(R)((RR-³stClassess#ee77aat Functionss#eeaa77tDatas#55aa55s
t __author__tAuthort __credits__tCredits(Xtobjectt__name__R tsplittpartstlinkstrangetlentiRtjoint linkednametheadRt getabsfiletpathturltsystplatformt nturl2patht pathname2urltfilelinkt TypeErrortinfothasattrtstrR!tversiontstriptselftescapeR#theadingR t getmemberstismoduletmodulestclassestcdicttisclassR(R)t getmodulet __bases__Rt __module__tmodnametgettmoduleRthas_keytfuncstfdictt isroutinet isbuiltint isfunctionRtpydoctisdatatmarkuptgetdoct preformattdoctpackageContexttcleantmodpkgstmodnamestostlistdirR'tfilet getmodulenamet ispackagetsortt multicolumnt modpkglinktcontentst moduleSectiont bigsectiontmapt classlistt formattreet getclasstreetdocumentt ExceptionRR2R4($ROR6R tmodRjtignoredR(RMR:RzR]RmR RpRvRlR9R@R?R_RRFR`RBRRJR[RR=RiRVRTR)RCRHRU((Rt docmoduleUsà 0   &#    $.  & $!  ! && &&  )  cCsm|itii|iƒ}}t||ƒo.t ||ƒ|jod|i||fSnt i ||ƒS(sMake a link for a class.s%sN( R6R7RDRTR\RZR R]RKRRdt classnameR[(ROR6R[R R]((Rt classlinkÔs &cCs§ti|tiƒ}|i||ƒ|i|ƒt|dƒo g} g}xºt i |i dƒD]¢}t ii|i d|ƒ}ti|ƒ}|o:||jo-| i||iddfƒ|i|ƒqeti|ƒo | i||iddfƒqeqeW| iƒx9| D]1\}}} } |it|i|fdƒƒqWg}xÚ| D]Ò\}}} }y”tid||fƒ}ti ti!|ƒƒ\} }| o0|id|i%||| |fƒ| fƒn#|i|i%||| |fƒƒWq^|i|i%||| |fƒƒq^Xq^Wt&i|dƒ}|i(dd d |ƒ}nB|o4|i*||d „ƒ}|i(d d d |ƒ}nd}|S(s;Create a module-links section for the given object (module)R'iiRs%s.%ss%s -- %ss
sPackage Contentss#ffffffs#aa55cccCs|\}}|i|ƒS(N(R(R)R*R+(R,R*R(R)((RR-sR.s#ffffftN(+RRRR6RSRTRjRkt recurseScanRKRlRmRnRoR'RpRBR>RqR[RR7RdRrRsR tyatyotaddInterestingtitemst isshadowedt safeimportR]tsplitdocRgt descriptiont documentationRORutstringRvRxR Rt(ROR6RjR]RmRŠRpRvR RrRlRR‡R†RBR[R R‰RŽRT((RRwÝsL $ #0&*(R7RZRRRƒRw(((RRTs t AlreadyDonecBstZRS(N(R7RZ(((RRstPackageDocumentationGeneratorcBsntZdZddffed„Zd„Zd„Zd„Zd„Zd„Z d „Z d „Z d „Z RS( sAA package document generator creates documentation for an entire package using pydoc's machinery. baseModules -- modules which will be included and whose included and children modules will be considered fair game for documentation destinationDirectory -- the directory into which the HTML documentation will be written recursion -- whether to add modules which are referenced by and/or children of base modules exclusions -- a list of modules whose contents will not be shown in any other module, commonly such modules as OpenGL.GL, wxPython.wx etc. recursionStops -- a list of modules which will explicitly stop recursion (i.e. they will never be included), even if they are children of base modules. formatter -- allows for passing in a custom formatter see DefaultFormatter for sample implementation. Ric Cstii|ƒ|_h|_g|_h|_h|_h|_ ||_ x|D]}d|i |R R˜R\R—R–(ROR¦R‰R¨R ((RR§]s&   cCsKz*x#|ioyƒ|ii|idƒot|idƒ‚n|idt|idƒƒti|idƒ}|idt|i ƒƒWn÷tj onsti j o>}|idt|ƒƒ|i dt|idƒƒn'ttfj o>}|idt|ƒƒ|i dt|idƒƒnØtj o>}|idt|ƒƒ|i dt|idƒƒnX|iiti|ƒ|ii||i d|ƒƒ}ttii|i|iddƒdƒ}|i|ƒ|iƒ||i|id<|id=qWWd x|iD] }|GHq7WXd S( s¼Having added all of the base and/or interesting modules, proceed to generate the appropriate documentation for each module in the appropriate directory, doing the recursion as we go.isStart %ss ... found %ss ... FAILED %ssUnable to import the module %sRjs.htmltwN(ROR›R—R^RRJR RdRR6R7RžR)RŸt SystemErrort SystemExitR~R¡tpagetdescribeRtopenRnRBR>R“RptwritetcloseR•titem(ROR6R)R±RpR¬((RtprocessqsH ""#     c CsÐxÉ|D]À\}}x±|iiƒD] }t||ƒoŠ||j o}t ||ƒ|jp t|dƒoS|i djoCg}|D]*\}}||jo|||fqˆqˆ~|(qÄq$q$WqWdS(sœcallback from the formatter object asking us to remove those items in the key, value pairs where the object is imported from one of the excluded modulesR7tNumericN(t objectListR(R)ROR”tvaluest excludeObjectRKR6RR7t_[1]tkto( ROR´R6R¶R)R·R¹R(R¸((RRk¡s 6cCs+x$|D]\}}|i|iƒqWdS(sSProcess the list of modules trying to add each to the list of interesting modulesN(R´R(R)RORˆR7(ROR´R)R(((RR…¯s ( R7RZR&RR¤RŸRJR£RˆR§R²RkR…(((RR‘s       0 t__main__s OpenGL.GLs OpenGL.GLUs OpenGL.GLUTs OpenGL.GLEs OpenGL.GLXs wxPython.wxR³t_tkintertTkintersOpenGLContext.debugR¢R“sz:\tempR”(R&RdRRnRRDtimptstattrettypesR tReprt expandtabstfindR>tlowerR8RNtrfindtrstripRtHTMLDocRR~RR‘R7texcludesRTR²(R‘RRÅRNRÃRÈR½RÁRR¿R8RÆR¾RRRDRÀRÄR>RRTRÂRdRn((Rt?s$? 7 J Û !