3 f1@sdgZdZdZdZddlZddlZddlZddlZddl Zddl Z ddl Z ddl Z ddl Z ddlZddlZddlZddlZddlZddlZddlZddlmZddlmZddlmZd d Zd d Zd dZddZddZ ddZ!ddZ"ej#dej$Z%ddZ&ddZ'ddZ(ddZ)d d!Z*dtd"d#Z+d$d%Z,d&d'Z-d(d)Z.d*d+Z/ifd,d-Z0Gd.d/d/e1Z2d0d1Z3difd2d3Z4Gd4d5d5Z5Gd6d7d7eZ6Gd8d9d9e5Z7Gd:d;d;eZ8Gdd?d?e9Z:d@dAa;dBdCZdHdIZ?dJdKZ@dLdMZAdNdOZBdPdQZCdudRdSZDe9ZEe:ZFe7ZGdvdTdUZHdwdWdXZIdxdYdZZJdyd[d\ZKdzd^d_ZLGd`dadaZMeMZNGdbdcdcZOdddeZPdfdgZQd{didjZRd|dkdldmdnZSdodpZTdqdrZUeVdskreUdS)}helpzKa-Ping Yee z26 February 2001zGuido van Rossum, for an excellent programming language. Tommy Burnette, the original creator of manpy. Paul Prescod, for all his work on onlinehelp. Richard Chamberlain, for the first implementation of textdoc. N)deque)Repr)format_exception_onlycCs`g}g}xRtjD]H}tjj|p d}tjj|}||krtjj|r|j||j|qW|S)N.)syspathosabspathnormcaseisdirappend)dirsZnormdirsdirZnormdirr/usr/lib64/python3.6/pydoc.pypathdirsLs   rcCs.tj|ptj|}|r*tjdd|jp,dS)Nz^ * )inspectgetdocZ getcommentsresubrstrip)objectresultrrrrXsrcCsh|jjd}t|dkr&|ddfSt|dkrZ|dj rZ|ddj|ddfSddj|fS)N rr)stripsplitlenrjoin)doclinesrrrsplitdoc]s   r$cCs"|j}|j|kr|jd|}|S)Nr)__name__ __module__)rmodnamenamerrr classnamefs r)cCs>tj|p:tj|p:tj|p:tj|p:tj|p:tj| S)N)rismoduleisclass isroutineZisframeZ istracebackZiscode)rrrrisdatamsr-cGs2x,|r,|dj|j|d}|dd}qW|S)Nrrr)r!r)textZpairsrrrreplacessr/cCsXt||krTtd|dd}td|d|}|d|d|t||dS|S)Nrrz...)r max)r.maxlenZpreZpostrrrcramzs  $r3z at 0x[0-9a-f]{6,16}(>+)$cCs tjd|S)Nz\1) _re_stripidr)r.rrrstripidsr5cCs(tj|p&tj|p&tj|p&tj|S)N)r isfunctionismethod isbuiltinZismethoddescriptor)objrrr_is_some_methods   r:cCs<tj|rdStj|r8t|dd}tj|p4|dk SdS)NT__self__F)rr7r8getattrr*)fnselfrrr_is_bound_methods    r?cCshi}x tj|tD]\}}d||<qWx|jD]}|jt|q.Wx|jD]}t||||<qNW|S)Nr)r getmembersr: __bases__update allmethodskeysr<)clmethodskeyvaluebaserrrrCs  rCcCs<g}g}x*|D]"}||r&|j|q|j|qW||fS)N)r )s predicateyesnoxrrr _split_lists  rOcCs\|dkr dS|jdr$|jdr$dS|jdrrYrQrTrPr&rRrXrSrZrVrWr]r\r[rUr%) startswithendswithhasattr)r(allr9rrr visiblenamesrecCsDg}x:tj|D],\}}}}tj|r*d}|j||||fqW|S)Nzdata descriptor)rclassify_class_attrsisdatadescriptorr )rresultsr(kindclsrHrrrrfs  rfc s\t|dgyfddtDWntk r>iYnXfdd}|j|ddS)Nr`csi|]\}}|t|qSr)r ).0ir()fieldsrr sz#sort_attributes..csj|dd|dfS)Nr)get)attr) field_orderrrsz!sort_attributes..)rG)r< enumerate TypeErrorsort)attrsrZkeyfuncr)rqrmrsort_attributess   rwcCs<tjj|r8x*dD]"}tjjtjj|d|rdSqWdS)N.py.pyc__init__TF)rxry)r rr isfiler!)rextrrr ispackages   r}cCs|j}x,|dddks$|j r4|j}|s Pq W|j}|dddkrZ|dd}|dddkr|dd}|d ddkr|dd }x|js|j}|sPqW|jddj}nd}|S) Nr#zr"""r0z"""\rr)readlinerr)filelinerrrrsource_synopsiss&    rc Cstj|j}|j|d\}}|dks.||kr|jttjjrJtjj }n |jttjj rftjj }nd}|dkryt j |}Wntk rdSX|t|}WdQRXnZ|d|}tjjd||d}ytjj|} Wn dStjd=| jr| jjdnd}||f||<|S)NZ__temp__)loaderr)NN)r statst_mtimerorbtuple importlib machineryBYTECODE_SUFFIXESSourcelessFileLoaderEXTENSION_SUFFIXESExtensionFileLoadertokenizeopenOSErrorrutilspec_from_file_location _bootstrap_loadrmodulesrU splitlines) filenamecachemtimeZ lastupdaterZ loader_clsrrspecmodulerrrsynopsiss4      rc@seZdZddZddZdS)ErrorDuringImportcCs||_|\|_|_|_dS)N)rexcrHtb)r>rexc_inforrrrz#szErrorDuringImport.__init__cCs|jj}d|j||jfS)Nzproblem in %s - %s: %s)rr%rrH)r>rrrr__str__'szErrorDuringImport.__str__N)r%r&r[rzrrrrrr!src Cstjj}t|d}||jt|k}WdQRXtjj|}tjj |\}}|r`tj j ||}ntj j ||}tjj |||d}y tjj|St|tjYnXdS)Nrb)r)rr MAGIC_NUMBERrreadr r rbasenamesplitext_bootstrap_externalrSourceFileLoaderrrrrrr) rmagicrZ is_bytecoderr(r|rrrrr importfile+s   rc s"yb|rXtjkrXtjkrXfddtjD}x(g|D]}tj|||<tj|=q:Wt}Wnxtj\}}}} tjkrttjj| n<|tkrt|j| n&t |t r|j krdSttjYnXx@j dddD]*} yt || }Wqtk rdSXqW|S)Ncsg|]}|jdr|qS)r)ra)rkm)rrr Qszsafeimport..rr)rrbuiltin_module_names __import__rrrV SyntaxErrorr issubclass ImportErrorr(rr<AttributeError) r forceloadrZsubsrGrrrHrinfopartr)rr safeimport=s.     rc@s|eZdZejjddejddZd ddZ dddZ e Z Z Z ZZZejjejd d ejddfd d ZdS)Doc PYTHONDOCSz%https://docs.python.org/%d.%d/libraryNrc Gs||f|}tj|r |j|Stj|r4|j|Sy@tj|rJ|j|Stj|r^|j|Stj|rr|j |SWnt k rYnXt |t r|j |S|j|S)N)risgetsetdescriptordocdataismemberdescriptorr* docmoduler+docclassr, docroutiner isinstanceproperty docpropertydocother)r>rr(argsrrrdocumentss"       z Doc.documentcGs*d|odt|t|jf}t|dS)Nz.don't know how to document object%s of type %s )reprtyper%rt)r>rr(rmessagerrrfailszDoc.faillibz python%d.%dcCsytj|}Wntk r&d}YnXtjjd|j}tjj|}t |t tr|j dks||j |r|j tjj |d  r|j dkr|j drd|jd|j jf}qtjj ||j jd}nd}|S)Nz (built-in)rerrno exceptionsgcimpmarshalposixsignalr_thread zipimportz site-packages xml.etreetest.pydoc_modhttp://https://z%s/%s/z.html) rrrrrrrrrr)rr)rr)r getabsfilertr environrorrr rrr%rar!rlower)r>rZbasedirrdoclocrrr getdoclocs$     z Doc.getdocloc)N)N)r%r&r[r rror version_inforrrrrrrrrrr!base_exec_prefixrrrrrrms   rc@sDeZdZddZddZddZddZd d ZeZd d Z eZ d S)HTMLReprcCs,tj|d|_|_d|_d|_|_dS)N d)rrzmaxlistmaxtuplemaxdict maxstringmaxother)r>rrrrzs  zHTMLRepr.__init__cCst|ddddddS)N&z&z>)r/)r>r.rrrescapeszHTMLRepr.escapecCs tj||S)N)rr)r>rrrrrsz HTMLRepr.reprcCsZtt|dr@ddjt|jj}t||r@t||||S|jttt ||j S)Nr%repr_r_) rcrr!r%rr<rr3r5rr)r>rNlevel methodnamerrrrepr1s  zHTMLRepr.repr1cCs^t||j}t|}d|krJdt|ddkrJd|d|j||dStjdd|j|S)Nrz\\rrrz-((\\[\\abfnrtv\'"]|\\[0-9]..|\\x..|\\u....)+)z\1)r3rrr/rrr)r>rNrtesttestreprrrr repr_strings zHTMLRepr.repr_stringc Cs8y|jttt||jS|jd|jjSdS)Nz <%s instance>)rr3r5rr __class__r%)r>rNrrrr repr_instanceszHTMLRepr.repr_instanceN) r%r&r[rzrrrrrepr_strrZ repr_unicoderrrrrs rc@s eZdZeZejZejZddZd4ddZd5d d Z d d Z d dZ d6ddZ ddZ ddZddZddZddZddZdiiifddZd7d d!Zd8d"d#Zddiifd$d%Zd&d'Zddiiidfd(d)Zd*d+Zd9d,d-Zd:d.d/Zd;d0d1Zd Python: %s %s r)r>titlecontentsrrrpagesz HTMLDoc.pagercCsd|||||pdfS)Na'
 
 
%s
%s
z r)r>rfgcolbgcolZextrasrrrheadings zHTMLDoc.headingN c Cs^|dkrdd|d}d|||f} |r@| d||||f} n| d|||f} | d|S)Nzz zz

zR z( z'
 
%s
%s %s
%s
%s%s%s
r) r>rrrrwidthZpreludeZ marginaliaZgaprrrrsectionszHTMLDoc.sectioncGsd|}|j|f|S)Nz%s)r)r>rrrrr bigsection szHTMLDoc.bigsectionc Cs&|j|j}t|dddddddd S)Nz z rz rz
)r expandtabsr/)r>r.rrr preformats zHTMLDoc.preformatrcCsd}t||d|}xht|D]\}|dd|}x>t|||||D]$}|t|krN||||d}qNW|d}q"Wd|S)Nrrzrz
zz7%s
)r range)r>listformatZcolsrrowscolrlrrr multicolumns  zHTMLDoc.multicolumncCsd|S)Nz%sr)r>r.rrrgrey sz HTMLDoc.greycGs*x$|D]}||krd|||fSqW|S)Nz%sr)r>r(Zdictsdictrrrnamelink"s zHTMLDoc.namelinkcCsN|jtjj|j}}t||rDt|||krDd|j|t||fSt||S)Nz%s)r%rrror&rcr<r))r>rr'r(rrrr classlink)s zHTMLDoc.classlinkcCsd|j|jfS)Nz%s)r%)r>rrrr modulelink1szHTMLDoc.modulelinkcCsR|\}}}}|r|j|S|r,d||f}nd|}|rBd|}n|}d||fS)Nz %s.%s.htmlz%s.htmlz"%s (package)z%s)r)r>Z modpkginfor(rr}shadowedurlr.rrr modpkglink5s   zHTMLDoc.modpkglinkcCs d||fS)Nz%sr)r>rrrrrfilelinkDszHTMLDoc.filelinkcCs|p|j}g}d}tjd}xL|j||} | s2P| j\} } |j|||| | j\} } }}}}| r|| jdd}|jd||fn|rdt|}|jd||| fn|rdt|}|jd||| fn|r$|| | dd kr|jd |j ||n|jd |n@|| | dd krR|j|j ||||n|j|j ||| }q W|j|||dd j |S) NrzD\b((http|ftp)://\S+[\w/]|RFC[- ]?(\d+)|PEP[- ]?(\d+)|(self\.)?(\w+))"z"z%sz'http://www.rfc-editor.org/rfc/rfc%d.txtz(http://www.python.org/dev/peps/pep-%04d/r(zself.zself.%sr) rrcompilesearchspanr groupsr/intrr!)r>r.rfuncsclassesrFrhherepatternmatchstartendrdschemeZrfcZpepZselfdotr(rrrrmarkupHs<      zHTMLDoc.markupc Csd}x|D]}t|tfkr|\}}|d}||j||}|r||fkrg}x|D]} |j|j| |qVW|ddj|d}|d}q t|tgkr |d|j|||}q Wd|S) Nrz"

rz, )z
z
%s
z
%s
)rrr r! formattree) r>treer'parentrentrycbasesparentsrIrrrr(ss    zHTMLDoc.formattreec#s|j}y |j}Wntk r(d}YnX|jd}g}x@tt|dD],}|jddj|d|d||fqJWdj||d-d} d| } y&tj |} t j j | } j | | } Wntk rd} YnXg}t|dr:t|j}|ddd.kr&|d/ddkr&|dd0j}|jd j|t|d r\|jjt|j|rt| d d j|} j|}|dk rdt}nd}j| ddd| |}tj|tj}gi}}xltj|tjD]Z\}}|dk stj|p||krt|||r|j||fd|||<||<qWx|D]\}}xx|jD]n}|j|j}}tj j!|}||krL|rLt||rLt"|||krL||krL|d|||<||<qLWq%sz)%sz (built-in)r] $z Revision: z version %srTz (%s)z, z-
Module Referencerz#ffffffz#7799eezindex
r~z.html#z#-z %sz

%s

rZrzPackage Contentsz#aa55cccsj|dS)Nr)r)t)r>rrrrsz#HTMLDoc.docmodule..ModulescSsg|] \}}|qSrr)rkrGrHrrrrsz%HTMLDoc.docmodule..ZClassesz#ee77aarZ Functionsz#eeaa77ZDataz#55aa55z
rPZAuthorrSZCreditsrz $Revision: rr)6r%__all__rrrr r r!rrurllibparseZquoterrtrcstrr]rrrTrlocalsrr@r*r+ getmodulererAr&rrror<r,r8r6r-r&rrpkgutil iter_modulesrZrur rrr( getclasstreerrPrS)#r>rr(modignoredrdpartsZlinksrlZ linkednameheadrrrrversionrrrrZcdictrGrHrIr'rrZfdictdatar"modpkgsimporterispkgr classlistr)r>rrs   &     $         $        zHTMLDoc.docmodulecsj}|p |}j}g} | jGfddd} | ttj} t| dkrjdx"| D]} dj| j qfWdfdd} fd d }fd d }fd dt D}ixv|D]n\}}}}d|d||<}yt |}Wnt k r:YnXy ||<Wqt k r^YqXqWx|rT| r|| jn |ddt|fdd\}}tjkr|}qfn"krd}ndjj }|d7}t|| d||dd}| d||dd}| d||dd}|d||dd}|d||d d}|}qfWd!j| } ||krxd"||f}nd#|||f}|rg}x"|D]} |jj| j qW|d$d%j|}jtj}|od&|}j|d'd(| d)|S)*Ncs eZdZddZfddZdS)z(HTMLDoc.docclass..HorizontalRulecSs d|_dS)Nr)needone)r>rrrrz sz1HTMLDoc.docclass..HorizontalRule.__init__cs|jrdd|_dS)Nz
r)rF)r>)pushrrmaybe sz.HTMLDoc.docclass..HorizontalRule.maybeN)r%r&r[rzrHr)rGrrHorizontalRule srIrz&
Method resolution order:
z
%s
z
cst||\}}|rj|xl|D]d\}}}}yt|}Wn&tk rhj||YnXj||dq(W|S)Nr)rOrHr< Exception_docdescriptorr)msgrvrKokr(rihomeclsrH)rrhrmdictr<rrGr>rrspills  zHTMLDoc.docclass..spillcsNt||\}}|rJj|x&|D]\}}}}j||q(W|S)N)rOrHrK)rLrvrKrMr(rirNrH)rOr<rGr>rrspilldescriptors/sz*HTMLDoc.docclass..spilldescriptorsc st||\}}|rj|x|D]\}}}}jt||}t|sZtj|rht|dd} nd} | dkrd|n0jt|j } d| } d|| fdq(W|S)NrUz
%s
z
%sz
%s%s
r) rOrHrr<callablerrgr&rr) rLrvrKrMr(rirNrHrIr")rrrOrPr<rrGr>rr spilldata8s"  z#HTMLDoc.docclass..spilldatacs,g|]$\}}}}t|dr||||fqS))r9)re)rkr(rirjrH)rrrrMs z$HTMLDoc.docclass..r~-rcs |dkS)Nrr)r1) thisclassrrrrfsz"HTMLDoc.docclass..z defined herezinherited from %sz:
z Methods %scSs |ddkS)Nrmethodr)r1rrrrrvszClass methods %scSs |ddkS)Nrz class methodr)r1rrrrrxszStatic methods %scSs |ddkS)Nrz static methodr)r1rrrrrzszData descriptors %scSs |ddkS)Nrzdata descriptorr)r1rrrrr|szData and other attributes %scSs |ddkS)NrrAr)r1rrrrr~srz*class %sz/%s = class %sz(%s)z, z%s
 
z#000000z#ffc8d8r0)r%rAr rrgetmror rHrr&rfr<rJrtpopleftrObuiltinsrrwr!r&rrr)r>rr(r<rrr=realnamer-rrImrorIrQrRrTrvrGrirNrHanchor inheritedtagrr.r"r) rrrOrPr<rrGr>rVrrs                              zHTMLDoc.docclasscCs|jd|j|S)N=)rr)r>rrrr formatvalueszHTMLDoc.formatvaluecCs|j}|p |}|r|jpdd|} d} d} t|r|jj} |rZ| |k rd|j| |} n0|jdk rzd|j|jj|} nd|j| |} ||krd| |f} nD|rtj||g|krd|jd||f}d } n|}d | ||f} d}tj|rNytj|}Wnt t fk r d}YnX|rNt |}|d krNd |} |d d}|sXd }| |j || ov|j d| }| rd|S|jt||j|||}|od|}d||fSdS)NrrUrz from z method of %s instancez unbound %s methodz$%sz%srz)%s = %szz$%s lambda z(...)z'%sz
%s
z
%s
z
%s
%s
r)r%r?r;rrrgetattr_staticr, signature ValueErrorrtr6rrr&rr)r>rr(r<rrrFrEr[r]noteskipdocsimclassrZreallinkargspecrcdeclr"rrrrsX       zHTMLDoc.docroutinecCsTg}|j}|r|d||jdk rB|jt||j}|d||ddj|S)Nz!
%s
z
%s
z
r)r rUr&rrr!)r>r(rHr<rhrGr"rrrrKs   zHTMLDoc._docdescriptorcCs|j|||S)N)rK)r>rr(r<rErrrrszHTMLDoc.docpropertycGs|r d|pd}||j|S)Nz%s = r)r)r>rr(r<r=ZlhsrrrrszHTMLDoc.docothercCs|j|||S)N)rK)r>rr(r<rErrrrszHTMLDoc.docdatacCsg}|dkri}xLtj|gD]<\}}}tdd|Drsz HTMLDoc.index..rrz#ffffffz#ee77aa)r9r:anyr rur rr)r>rrrBrCr(rDrrrrindexs z HTMLDoc.index)r)rrNr)r)N)NN)NNN)NN)NNN)N)r%r&r[r_repr_instancerrrrrrrr rrrrrrr&r(rrrarrKrrrrnrrrrrs:   +  y:   rc@s0eZdZddZddZddZeZddZd S) TextReprcCs,tj|d|_|_d|_d|_|_dS)Nrrr)rrzrrrrr)r>rrrrzs  zTextRepr.__init__cCsTtt|dr@ddjt|jj}t||r@t||||Sttt||j S)Nr%rr_) rcrr!r%rr<r3r5rr)r>rNrrrrrrs  zTextRepr.repr1cCsHt||j}t|}d|krDdt|ddkrDd|d||dS|S)Nrz\\rrr)r3rrr/)r>rNrrrrrrr s  zTextRepr.repr_stringc Cs,yttt||jSd|jjSdS)Nz <%s instance>)r3r5rrrr%)r>rNrrrrrszTextRepr.repr_instanceN)r%r&r[rzrrrrrrrrrps  rpc@seZdZeZejZddZdddZddZdd d Z dd d Z dddZ ddZ d ddZ ddZd!ddZd"ddZd#ddZdS)$TextDoccCsdjdd|DS)Nrcss|]}|d|VqdS)Nr)rkrkrrrrl(szTextDoc.bold..)r!)r>r.rrrbold&sz TextDoc.bold cs>|sdSfdd|jdD}|r4|dj|d<dj|S)Nrcsg|] }|qSrr)rkr)prefixrrr-sz"TextDoc.indent..rrrr)rrr!)r>r.rur#r)rurindent*s zTextDoc.indentcCs$|j|j}|j|d|dS)Nrz )rvrrs)r>rrZclean_contentsrrrr1szTextDoc.sectionNrc sd}x|D]}t|tfkrt|\}}||t|}|rj||fkrjfdd|D} |ddj| }|d}q t|tgkr ||j|||d}q W|S)Nrc3s|]}t|VqdS)N)r))rkr,)r'rrrl@sz%TextDoc.formattree..z(%s)z, rz )rr)r!r() r>r)r'r*rurr+r,r-r.r)r'rr(8s  zTextDoc.formattreec CsD|j}tt|\}}|jd||o(d|}t|dd}|j|}|dk r`||jd|d}|rt||jd|}g} xNtj|tjD]<\} } |dk stj | p||krt | ||r| j | | fqWg} xXtj|tj D]F\} } |dk stj | stj | |krt | ||r| j | | fqWg} x6tj|tD]&\} } t | ||r8| j | | fq8Wg}t}t|drxFtj|jD]6\}}}|j||r|j |dn |j |qW|j||jd d j|}g}xBtj|tjD]0\} } | jj|d r| |kr|j | qW|rJ|j||jd d j|}| rd d| D}|jtj|d|g}x&| D]\} } |j |j| | |qzW||jdd j|}| rg}x&| D]\} } |j |j| | |qW||jdd j|}| rFg}x*| D]"\} } |j |j| | |ddq W||jdd j|}t|drt|j}|ddd"kr|d#ddkr|dd$j}||jd|}t|dr||jdt|j }t|dr||jdt|j!}t|dr||jdt|j"}ytj#|}Wnt$k r.d }YnX||jd!|}|S)%NNAMEz - r3zMODULE REFERENCEa. The following documentation is automatically generated from the Python source files. It may be incomplete, incorrect or include features that are considered implementation detail and may vary between Python implementations. When in doubt, consult the module reference at the location listed above. Z DESCRIPTIONrZz (package)zPACKAGE CONTENTSrrZ SUBMODULEScSsg|] \}}|qSrr)rkrGrHrrrrsz%TextDoc.docmodule..rCLASSES FUNCTIONSF)r2ZDATAr]r/r0z Revision: VERSIONrTZDATErPZAUTHORrSZCREDITSz (built-in)ZFILEz $Revision: rr)%r%r$rrr<rrr@r+r8rer r,r8r-setrcr9r:rZaddrur!r*rar(r;rrr6r]rrTrPrSrrt)r>rr(r<ZsynopdescrrdrrrGrHrrArBZ modpkgs_namesrCr'rDZ submodulesrErr@rrrrrHs           $    zTextDoc.docmodulecsXj}|p |}j}jfdd}||kr:dj|}nj|d|}|rlt||} |ddj| }t} | r| dgpg} | jtt j } t | dkrԈd x| D]} d || qWd Gfd d d }|fdd}fdd}fdd}fddt D}x|r"| rT| j n |ddt|fdd\}}tjkr|}q>n krd}ndtj}t||d||dd}|d||dd}|d||d d}|d!||d"d}|d#||d$d}|}q>Wdj| } | s<|dS|dj| jd%dS)&NcSs t||S)N)r))r,rrrrmakenamesz"TextDoc.docclass..makenamezclass z = class z(%s)z, rrzMethod resolution order:z rcs eZdZddZfddZdS)z(TextDoc.docclass..HorizontalRulecSs d|_dS)Nr)rF)r>rrrrzsz1TextDoc.docclass..HorizontalRule.__init__cs|jrddd|_dS)NrUrzr)rF)r>)rGrrrHs z.TextDoc.docclass..HorizontalRule.maybeN)r%r&r[rzrHr)rGrrrIsrIcst||\}}|rj|x^|D]V\}}}}yt|}Wn&tk rhj||Yq(Xj||q(W|S)N)rOrHr<rJrKr)rLrvrKrMr(rirNrH)rOr<rrGr>rrrQszTextDoc.docclass..spillcsNt||\}}|rJj|x&|D]\}}}}j||q(W|S)N)rOrHrK)rLrvrKrMr(rirNrH)rOr<rGr>rrrRsz*TextDoc.docclass..spilldescriptorsc st||\}}|rj|x~|D]v\}}}}t|sFtj|rPt|}nd}yt|} Wntk r|j|} YnXj | |d|ddq(W|S)Nrz)r2r"r) rOrHrSrrgrr<r__dict__r) rLrvrKrMr(rirNrHr"r9)rOr<rrGr>rrrTs  z#TextDoc.docclass..spilldatacs,g|]$\}}}}t|dr||||fqS))r9)re)rkr(rirjrH)rrrrs z$TextDoc.docclass..rcs |dkS)Nrr)r1)rVrrrr sz"TextDoc.docclass..z defined herezinherited from %sz Methods %s: cSs |ddkS)NrrWr)r1rrrrrszClass methods %s: cSs |ddkS)Nrz class methodr)r1rrrrrszStatic methods %s: cSs |ddkS)Nrz static methodr)r1rrrrrszData descriptors %s: cSs |ddkS)Nrzdata descriptorr)r1rrrrrszData and other attributes %s: cSs |ddkS)NrrAr)r1rrrrr sz | )r%rAr&rsmapr!rr rrrXr rfrYrOrZrr)rwrvr)r>rr(r<r=r[r-rrr.r"rr\rIrIrQrRrTrvr^r_r)rOr<rrGr>rVrrsl                        zTextDoc.docclasscCsd|j|S)Nr`)r)r>rrrrra*szTextDoc.formatvaluec Csr|j}|p |}d}d}t|rn|jj}|rB||k rndt||}n,|jdk r`dt|jj|}ndt||}||kr|j|} n,|rtj||g|krd}|j|d|} d} tj|rytj |} Wnt t fk rd} YnX| rt | } |dkr|j|d } | dd } | s&d } | | |} |r@| d St |pLd} | d | oj|j| jd SdS) Nrrz from z method of %s instancez unbound %s methodrz = zz lambda z(...)rr)r%r?r;rr)rsrrbr,rcrdrtr6rrvr)r>rr(r<rEr[rerfrgrrhrcrir"rrrr.sH       zTextDoc.docroutinecCsTg}|j}|r$||j||dt|p.d}|rJ||j||ddj|S)Nrr)r rsrrvr!)r>r(rHr<rhrGr"rrrrK_s zTextDoc._docdescriptorcCs|j|||S)N)rK)r>rr(r<rErrrrlszTextDoc.docpropertycCs|j|||S)N)rK)r>rr(r<rErrrrpszTextDoc.docdatac Cs|j|}|rF|r|dpd|}|t|} | dkrF|d| d}|rX|j|dpZd|}|dk r~|d|jt|7}|S)Nz = rrz...r)rr rsrvr6) r>rr(r<r*r2r"rrZchoprrrrts  zTextDoc.docother)rt)Nr)NN)NN)NNN)NNN)NNN)NNNNN)r%r&r[rprorrsrvrr(rrrarrKrrrrrrrrqs   e } 1  rqc@seZdZddZdS) _PlainTextDoccCs|S)Nr)r>r.rrrrssz_PlainTextDoc.boldN)r%r&r[rsrrrrrsrcCstat|dS)N)getpagerpager)r.rrrrsrc s<ttjdstSttjds tStjj s8tjj r.ZTERMdumbemacscstt|S)N) pipepagerr)r.)rrrrrscs t|S)N)r)r.)rrrrrscSstt|dS)Nzmore <)rr)r.rrrrrssystemz(less) 2>/dev/nullrcSs t|dS)NZless)r)r.rrrrrsz more "%s"cSs t|dS)NZmore)r)r.rrrrrs)rr)rr)rcrstdin plainpagerstdoutrr rroplatformrtempfileZmkstempclosettypagerunlink)rfdrr)rrrs6          rcCstjdd|S)Nz.r)rr)r.rrrrsrc Csddl}|j|d|jd}yDtj|jdd*}y|j|Wntk rPYnXWdQRXWntk rrYnXx(y|j PWqvtk rYqvXqvWdS)NrT)shellrbackslashreplace)errors) subprocessPopenPIPEio TextIOWrapperrwriteKeyboardInterruptrwait)r.cmdrprocpiperrrrs rcCs`ddl}|j}t|ddd}|j|WdQRXztj|d|dWdtj|XdS)Nrwr)rz "r)rZmktemprrr rr)r.rrrrrrrrsrcCs$ttjddpd}|j|dj|S)Nencodingzutf-8r)r<rrencodedecode)r.rrrr_escape_stdoutsrc Cstt|jd}y2ddl}tjj}|j|}|j|dd}Wn(t t t j fk rld}dd}YnXz2yt tjjdd}Wntk rd}YnX|dkrd}|d}}tjjdj|d|dx||drtjjd tjj|} | dkrtjjd Pn,| dkrJtjjd ||d|d}q| dkrn|||}|dkrnd}tjjddj||||d||}qWWd|r|j||j|XdS)NrrcSs tjjdS)Nr)rrrrrrrrrszttypager..cSstjjddddS)Nrr)rrrrrrrrrsZLINESrz -- more --qQz  bB)rr)rr)rrr)rrrttyrrfilenoZ tcgetattrZ setcbreakrrrUnsupportedOperationrr rrordrrr!flushZ tcsetattrZ TCSAFLUSH) r.r#rroldZgetcharhrZincr,rrrrsL              &rcCstjjtt|dS)N)rrrrr)r.rrrrsrcCstj|r>|jtjkr d|jSt|dr4d|jSd|jStj|rRd|jStj|rtd|jj |jj|jfStj |rd|jj |jj|jfStj |rd|jStj |rd |jStj |rd |jSt|jS) Nzbuilt-in module rZzpackage zmodule zbuilt-in function zgetset descriptor %s.%s.%szmember descriptor %s.%s.%szclass z function zmethod )rr*r%rrrcr8r __objclass__r&rr+r6r7r)thingrrrdescribe s.                    rc Csdd|jdD}d\}}xB|t|kr^tdj|d|d|}|rZ||d}}qPqW|rj|}nt}x8||dD](}yt||}Wq|tk rdSXq|W|S)NcSsg|] }|r|qSrr)rkrrrrr'szlocate..rrr)Nr)rr rr!rZr<r)rrr>rnZ nextmodulerrrrrlocate%s  rcCsVt|tr0t||}|dkr(td|||fSt|dd}|t|trL|ndfSdS)Nz~No Python documentation found for %r. Use help() to get the interactive help utility. Use help(str) for help on the str class.r%)rr6rrr<)rrrr(rrrresolve>s    r Python Library Documentation: %scCs|dkr t}t||\}}t|}tj|}|rTd|krT|d|d|jd7}n|rn||k rn|d|j7}tj|ptj|ptj |ptj |ptj |pt |t st|}|d7}||d|j||S)Nrz in z in module z objectz )r.rrrr8rfindr%r*r+r,rrrrrr)rrrZrendererrr(r~rrrr render_docLs$         rcCsfy2|dkrtt|||n|jt|||tWn.ttfk r`}zt|WYdd}~XnXdS)N)rrr plaintextrrprint)rrroutputrHrrrr"es r"cCsy`t||\}}tjt|tj||}t|dddd}|j|WdQRXtd|dWn.tt fk r}zt|WYdd}~XnXdS)Nz.htmlrzutf-8)rZwrote) rhtmlrrrrrrrr)rrrr(rrrHrrrwritedocpsrrcCs6|dkr i}x$tj|g|D]\}}}t|qWdS)N)r9 walk_packagesr)rpkgpathdonerCr'rDrrr writedocs{s  rcJ@seZdZdddddddddddd dddddddddddddddddddddd&!Zd'd(dDZdedddd d d dSZdTdUdVdWdXdYdZd[d\d]d^d_d_d`d`daZxPejD]D\ZZ x8e D]0Z ej e eZ ee kre dbeZ e ee <qWqWd d dddddddddvdddddddddddddddd d!d"d#d$d%d&d'd(d)d*ddd+d,d-d.d/d0dd1d2d3d4d5d6d7d8d9d:d;d<d=d>d?d@ddAdBd d!dd dCdDdEdFdʜIZ dGdd̈́Z eddτZeddτZdd҄ZeZefddԄZddքZdd؄ZddڄZdd܄ZdHddZddZddZddZdIddZdJddZddZdKddZ dS(LHelperrBOOLEANwithassertbreak while forclassCLASSES SPECIALMETHODScontinuefunctiondel BASICMETHODSifelsetryforbreak continue whileimportglobalnonlocal NAMESPACES TRUTHVALUEMODULESinSEQUENCEMETHODS COMPARISONlambdarynonlocalglobal NAMESPACESpassraise EXCEPTIONSreturnwhilebreak continue if TRUTHVALUE CONTEXTMANAGERS EXCEPTIONS yieldyield)!FalseNoneTrueandasrrrrdefrelifrexceptfinallyrfromrrrrisrrnotorrrrrrrrcCsg|]}dD] }||q qS)'r)rrr)rkprrrrrszHelper.rfrur'''r"""+rU***r//%<<>>r|^~rr<=>===!=<>+=-=*=/=%=&=|=^=<<=>>=**=//=jJ)STRINGS OPERATORSrUNARYAUGMENTEDASSIGNMENTBITWISECOMPLEXzOPERATORS FORMATTINGPOWERzTUPLES LISTS FUNCTIONSz ATTRIBUTES FLOAT MODULES OBJECTSELLIPSISzSLICINGS DICTIONARYLITERALSz def classr PRIVATENAMESzPRIVATENAMES SPECIALMETHODSZ BACKQUOTESzTUPLES FUNCTIONS CALLSzLISTS SUBSCRIPTS SLICINGS)rz**,rz...:@rr_r^`rr'[]rtypesRSTRINGS UNICODE NUMBERS SEQUENCES MAPPINGS FUNCTIONS CLASSES MODULES FILES inspectstrings4str UNICODE SEQUENCES STRINGMETHODS FORMATTING TYPESstring-methodsSTRINGS FORMATTING formatstringsr:encodings unicode SEQUENCES STRINGMETHODS FORMATTING TYPESnumbersINTEGER FLOAT COMPLEX TYPESintegers int rangefloating float math imaginary complex cmathtypesseq$STRINGMETHODS FORMATTING range LISTS DICTIONARIEStypesfunctions def TYPES typesmethodsclass def CLASSES TYPESbltin-code-objectscompile FUNCTIONS TYPESbltin-type-objects types TYPESTYPESbltin-null-objectbltin-ellipsis-objectSLICINGS specialattrs!class SPECIALMETHODS PRIVATENAMES typesmodulesoperator-summarylambda or and not in is BOOLEAN COMPARISON BITWISE SHIFTING BINARY FORMATTING POWER UNARY ATTRIBUTES SUBSCRIPTS SLICINGS CALLS TUPLES LISTS DICTIONARIES EXPRESSIONSobjects specialnamesbBASICMETHODS ATTRIBUTEMETHODS CALLABLEMETHODS SEQUENCEMETHODS MAPPINGMETHODS NUMBERMETHODS CLASSES customizationhash repr str SPECIALMETHODSattribute-accessATTRIBUTES SPECIALMETHODScallable-typesCALLS SPECIALMETHODSsequence-types(SEQUENCES SEQUENCEMETHODS SPECIALMETHODSMAPPINGS SPECIALMETHODS numeric-types*NUMBERS AUGMENTEDASSIGNMENT SPECIALMETHODS execmodel%NAMESPACES DYNAMICFEATURES EXCEPTIONSnaming3global nonlocal ASSIGNMENT DELETION DYNAMICFEATURESdynamic-features NAMESPACESrtry except finally raise conversions identifierskeywords SPECIALIDENTIFIERS id-classesatom-identifiers atom-literals=STRINGS NUMBERS TUPLELITERALS LISTLITERALS DICTIONARYLITERALS SEQUENCES exprlistsTUPLES LITERALStypesseq-mutable LISTLITERALSlistsLISTS LITERALS typesmappingDICTIONARYLITERALSrDICTIONARIES LITERALSattribute-references(getattr hasattr setattr ATTRIBUTEMETHODS subscriptionsslicingscallspowerunarybinaryshiftingbitwise comparisonsEXPRESSIONS BASICMETHODSbooleansEXPRESSIONS TRUTHVALUE assignmentr augassign NUMBERMETHODScompoundfor while break continuetruth if while and or not BASICMETHODSdebuggerpdbcontext-managers)IrFrZ STRINGMETHODSZ FORMATTINGUNICODEZNUMBERSZINTEGERZFLOATr!rlZMAPPINGSryZMETHODSZ CODEOBJECTSZ TYPEOBJECTSZ FRAMEOBJECTSZ TRACEBACKSZNONEr#ZSPECIALATTRIBUTESrxrZPACKAGESrOrZ PRECEDENCEZOBJECTSZSPECIALMETHODSrZATTRIBUTEMETHODSZCALLABLEMETHODSrZMAPPINGMETHODSrZ EXECUTIONrcZDYNAMICFEATURESZSCOPINGZFRAMESrZ CONVERSIONSZ IDENTIFIERSZSPECIALIDENTIFIERSr$ZLITERALSZTUPLESZ TUPLELITERALSZLISTSrpr=rtZ ATTRIBUTESZ SUBSCRIPTSrIZCALLSr"rZBINARYZSHIFTINGr rrZ ASSERTIONZ ASSIGNMENTrZDELETIONZ RETURNINGZ IMPORTINGZ CONDITIONALZLOOPINGrZ DEBUGGINGZCONTEXTMANAGERSNcCs||_||_dS)N)_input_output)r>inputrrrrrz/szHelper.__init__cCs |jp tjS)N)rrr)r>rrrrr3szHelper.cCs |jp tjS)N)rrr)r>rrrrr4scCs2tjdddkr|dSd|jj|jjfS)Nrr0?rz<%s.%s instance>)rstackrr&r[)r>rrr__repr__6s zHelper.__repr__cCs6||jk r|j|n|j|j|jjddS)Na You are now leaving help and returning to the Python interpreter. If you want to ask for help on a particular object directly from the interpreter, you can type "help(object)". Executing "help('string')" has the same effect as typing a particular string at the help> prompt. )_GoInteractiverintrointeractrr)r>requestrrr__call__>s   zHelper.__call__c Cs|jjdxy|jd}|s PWnttfk r<PYnX|j}t|dkr|d|d kold knr|d|dd kr|dd}|jdkrP|d kr|jq|j |qWdS)Nrzhelp> rrrrrrquitrr)rrrr)rr) rrgetlinerEOFErrorrr rrr)r>rrrrrKs"  ,   zHelper.interactcCs8|jtjkrt|S|jj||jj|jjSdS)N)rrrrrrr)r>promptrrrr`s    zHelper.getlinecCs<t|tdkr|j}|dkr,|jn|dkr>|jn|dkrP|jn|dkrb|jn|dddkr|j|jdn||jkr|j|nj|dkrt t |d nR||j kr|j |n<||j kr|j |n&|rt |d |jd nt td |jd n$t|tr|nt |d |jd |jjddS)Nrkeywordssymbolstopicsrzmodules rrrrz Help on %s:)rr)rrr)rr listkeywords listsymbols listtopics listmodulesrr showsymbolr"evalr showtopicrrr6rrrr)r>rrrrris6        z Helper.helpcCs$|jjdjdtjdddS)Na Welcome to Python {0}'s help utility! If this is your first time using Python, you should definitely check out the tutorial on the Internet at https://docs.python.org/{0}/tutorial/. Enter the name of any module, keyword, or topic to get help on writing Python programs and using Python modules. To quit this help utility and return to the interpreter, just type "quit". To get a list of available modules, keywords, symbols, or topics, type "modules", "keywords", "symbols", or "topics". Each module also comes with a one-line summary of what it does; to list the modules whose name or summary contain a given string such as "spam", type "modules spam". z%d.%dr)rrr rr)r>rrrr~sz Helper.introrPc Cstt|}||}t||d|}xt|D]z}xht|D]\}|||}|t|kr@|jj||||dkr@|jjdd|dt||q@W|jjdq2WdS)Nrrr)r sortedr rrr) r>itemscolumnsrZcolwr rowr rlrrrr s    (z Helper.listcCs |jjd|j|jjdS)NzN Here is a list of the Python keywords. Enter any keyword to get more help. )rrr rrD)r>rrrrszHelper.listkeywordscCs |jjd|j|jjdS)Nzx Here is a list of the punctuation symbols which Python assigns special meaning to. Enter any symbol to get more help. )rrr rrD)r>rrrrszHelper.listsymbolscCs |jjd|j|jjdS)NzN Here is a list of available topics. Enter any topic name to get more help. )rrr rrD)r>rrrrszHelper.listtopicsc Cs,y ddl}Wn tk r,|jjddSX|jj||jj|}|s`|jjdt|dSt|tdkr||j ||S|\}}y|jj|}Wn(t k r|jjdt|dSX|j d}|r|pdd|}|r ddl }ddj |jd} |j| d } |d dj | 7}t|dS) Nrzt Sorry, topic and keyword documentation is not available because the module "pydoc_data.topics" could not be found. zno documentation found for %s rrrzRelated help topics: z, Hz %s )pydoc_data.topicsrrrrrorrrrKeyErrorrtextwrapr!rZwrapr) r>topic more_xrefs pydoc_datatargetlabelxrefsr"rr.Z wrapped_textrrrrs6    zHelper.showtopicc Csy ddl}Wntk r dSX|jj||jj|}|sDtdt|trZ|j||S|\}}|jj|}|r|pxdd|}||fS)Nrt Sorry, topic and keyword documentation is not available because the module "pydoc_data.topics" could not be found. rzcould not find topicr)rr) rrrrorrdrr6 _gettopic)r>rrrrrrr"rrrrs     zHelper._gettopiccCs*|j|}|jd\}}}|j||dS)Nr)r partitionr)r>symbolrrr_rrrrrs zHelper.showsymbolcsv|r |jjdj|t|nR|jjdi}|fddfdd}tj|d|j|j|jjddS) Nzy Here is a list of modules whose name or summary contains '{}'. If there are any, enter a module name to get more help. zI Please wait a moment while I gather a list of all available modules... cSs>|r$|dddkr$|ddd}|jddkr:d||<dS) N z .__init__z (package)rrrii)find)rr'r~rrrrcallbacksz$Helper.listmodules..callbackcsd|ddS)Nr)r')rrronerrorsz#Helper.listmodules..onerror)rz Enter any module name to get more help. Or, type "modules spam" to search for modules whose name or summary contain the string "spam". )rrr apropos ModuleScannerrunr rD)r>rGrrr)rrrs    zHelper.listmodules)rr)rr)rr)rr)rr)rr)rr)rr)rr)rr)rr)rr)rry)rr)rr)rr)rry)rr)rr)rr)rr)rrrr)rrrr)rrUrrrrrrrrrrrrrr r r r r )rrr r r r r )rUr) rrrrrrrrrrrr)rrrrrr)rr)r+r,)r-r.)r/r0)r1r)r-r2)r3r4)r5r6)r7r8)r9r:)r;r<)r>r?)r@rA)rBrC)rDrE)rGr)rHrI)rJr)r+rK)rLr)rMrN)rPrF)rQrR)rSrT)rUrV)rWrX)rYrZ)rYr[)r\r])r^r_)r`ra)rbr)rrd)rer)rfrg)rhr)rir)rjrk)rmrn)rorp)rqrr)rsrt)rru)rvrw)rxr)ryr)rzrO)r{rO)r|rO)r}rO)r~rO)rrO)rr)rr)rr)rr)rr)rr)rr)rr)NN)rr)r)r)r)!r%r&r[rZ _strprefixesZ_symbols_inverserrrZsymbols_rrorrzrrrrrrrrrrrr rrrrrrrrrrrrs6              rc@seZdZdddZdS)rNcCs |r |j}d|_i}xztjD]p}|dkrd||<|dkrH|d|dqt|jpTd}|jdd}|d|}|jj|dkr|d||qWxdtj |dD]R\} }} |jrP|dkr|d|dqytj | |} Wnt k rwYnX| j } t | d rny| j|} Wn&tk r:|r4||wYnXttj| pNd}t | d rh| j|}nd}n^ytjj| }Wn&tk r|r||wYnX|jr|jjdnd}t|d d}|d|}|jj|dkr||||qW|r|dS) NF__main__rrrrz - )r get_source get_filenamerV)rrrrrrUrrr9r _get_specrrrcrrJrrStringIOrrrrrrr<)r>rrGZ completerrseenr'r(r~rCrDrrsourcerrrrrrs`       zModuleScanner.run)NNN)r%r&r[rrrrrrsrc CsDdd}dd}tj"tjdtj|||dWdQRXdS)NcSs6|dddkr |ddd}t||o.d|dS)Nrz .__init__z (package)z- ii)r)rr'r~rrrrOszapropos..callbackcSsdS)Nr)r'rrrrSszapropos..onerrorignore)r)warningscatch_warningsfilterwarningsrr)rGrrrrrrMs   rcsddlddlddlddlGdddjjGfdddjjGfdddj}|||}|jx|j r|j rt j dq~W|S) Nrc@seZdZddZddZdS)z!_start_server..DocHandlercSsX|jjdrd}nd}|jd|jdd||j|jj|j|j|jddS)Nz.cssztext/cssz text/htmlz Content-Typez%s; charset=UTF-8zutf-8) rrbZ send_responseZ send_headerZ end_headersZwfiler urlhandlerr)r> content_typerrrdo_GETs   z(_start_server..DocHandler.do_GETcWsdS)Nr)r>rrrr log_messagesz-_start_server..DocHandler.log_messageN)r%r&r[rrrrrr DocHandlersrcs(eZdZddZfddZddZdS)z _start_server..DocServercSs6d|_|j|f|_||_|jj||j|jd|_dS)NZ localhostF)hostZaddressrrIrzhandlerr)r>portrrrrrzs  z)_start_server..DocServer.__init__csBx4|js4j|jjgggd\}}}|r|jqW|jdS)Nr)rselectZsocketrZhandle_requestZ server_close)r>ZrdwrZex)rrrserve_until_quits  z1_start_server..DocServer.serve_until_quitcSs |jj||jr|j|dS)N)rIserver_activater)r>rrrrs z0_start_server..DocServer.server_activateN)r%r&r[rzrrr)rrr DocServers rcs:eZdZfddZfddZddZddZd S) z#_start_server..ServerThreadcs,||_t||_jj|d|_d|_dS)NF)rrrThreadrzservingerror)r>rr) threadingrrrzs   z,_start_server..ServerThread.__init__cstyFjj__jj_t|j_|j |j }||_ |j Wn(t k rn}z ||_WYdd}~XnXdS)N)server HTTPServerrIrrZMessageZ MessageClass staticmethodrrready docserverrrJr)r>Zdocsvre)rremailhttprrrs    z'_start_server..ServerThread.runcSs,d|_|j|_|j|_d|j|jf|_dS)NTz http://%s:%d/)rrZ server_portrr)r>rrrrrsz)_start_server..ServerThread.readycSs&d|j_|jd|_d|_d|_dS)NTF)rrr!rr)r>rrrstops z(_start_server..ServerThread.stopN)r%r&r[rzrrrr)rrrrrrr ServerThreads  rg{Gz?) Z http.serverZ email.messagerrrZBaseHTTPRequestHandlerrrr#rrtimeZsleep)rrrZthreadr)rrrrrrr _start_server[s8& r text/htmlc s*Gfdddt}|fddfddfddfd d fd d  fd dfddfddfdd f dd}|jdr|dd}|dkrtjjtjjt}tjj||}t|}dj|j SQRXn|dkr||St d||fdS)Ncs eZdZfddZddZdS)z_url_handler.._HTMLDoccsd}d|}d|||fS)Nzpydoc_data/_pydoc.cssz1a  Pydoc: %s %s%s
%s
r)r>rrcss_pathZcss_link) html_navbarrrrsz#_url_handler.._HTMLDoc.pagecSs d||fS)Nz%sr)r>rrrrrr sz'_url_handler.._HTMLDoc.filelinkN)r%r&r[rrr)rrr_HTMLDocs rcs>jdtjtjdtjf}d|jtjddfS)Nz %s [%s, %s]raZ
Python %s
%s
T)Zterse)rrZpython_versionZ python_buildZpython_compiler)r@)rrrr s  z!_url_handler..html_navbarcsdd}jddd}ddtjD}j||}|djd dd |g}i}x tjD]}|jj||qVW|jd d d j|fS)NcSs d||fS)Nz%sr)r(rrr bltinlink. sz3_url_handler..html_index..bltinlinkz7Index of Modulesz#ffffffz#7799eecSsg|]}|dkr|qS)rr)rkr(rrrr4 sz4_url_handler..html_index..z

zBuilt-in Modulesz#ee77aaz|

pydoc by Ka-Ping Yee<ping@lfw.org>zIndex of Modulesr) rrrr rrr rnr!)rrnamesrrr)rrr html_index+ s  z _url_handler..html_indexc sgfdd}tj*tjddd}tj|||dWdQRXdd}g}jd d d }x"D]\}}|j|||qhW|jd |d d dj|}d|fS)Ncs:|dddkr |ddd}j||o0d|fdS)Nrz .__init__z (package)z- ii)r )rr'r~) search_resultrrrI sz3_url_handler..html_search..callbackrcSsdS)Nr)r'rrrrP sz2_url_handler..html_search..onerror)rcSs d||fS)Nz%sr)r(rrrrU sz4_url_handler..html_search..bltinlinkz5Search Resultsz#ffffffz#7799eezkey = %sz#ee77aaz
zSearch Results) rrrrrrr rr!) rGrrrrhrr(r~r)r)rr html_searchD s    z!_url_handler..html_searchc sjtjj|}tj|}j|j}WdQRXd|}jddd}|jd|dd|}d||fS)Nz

%s
z3File Listingz#ffffffz#7799eezFile: %sz#ee77aaz getfile %s) r4r5Zunquoterrrrrr)rfpr#Zbodyrr)rrr html_getfileb s  z"_url_handler..html_getfilecsLdd}jddd}ttjj}j||}|jddd|}d|fS)NcSs d||fS)Nz%sr)r(rrrrr sz4_url_handler..html_topics..bltinlinkz,INDEXz#ffffffz#7799eeZTopicsz#ee77aa)rrrrrDr r)rrrr)rrr html_topicso s z!_url_handler..html_topicscsLjddd}ttjj}dd}j||}|jddd|}d|fS)Nz,INDEXz#ffffffz#7799eecSs d||fS)Nz%sr)r(rrrr sz6_url_handler..html_keywords..bltinlinkZKeywordsz#ee77aa)rrrrrDr r)rrrr)rrr html_keywords s z#_url_handler..html_keywordscstj}t||}|j|\}}||jkr0d}nd}jd|dd}dj|}j|dd|}|rt|j }dd }j ||}j d dd|}d ||fd j |||ffS) NZKEYWORDZTOPICz)%sz#ffffffz#7799eez
%s
z#ee77aacSs d||fS)Nz%sr)r(rrrr sz7_url_handler..html_topicpage..bltinlinkzRelated help topics: z%s %sr) rrrrrrr&rrrr rr!)rZbufZhtmlhelprrrrr)rrrhtml_topicpage s&      z$_url_handler..html_topicpagecs@t|dd}|dkr$|dkr$tdt|}j||}||fS)Nr)rrzcould not find object)rrdrr)rr9rcontent)rrr html_getobj s   z!_url_handler..html_getobjcsPjddd}djfddtt||D}|j|dd|}d||fS) Nz,Errorz#ffffffz#7799eez
c3s|]}j|VqdS)N)r)rkr)rrrrl sz3_url_handler..html_error..z#bb0000z Error - %s)rr!rrr)rrrr)rrr html_error s z _url_handler..html_errorcs|}|jdr|dd }y2|dkr4\}}n|dkrJ\}}n|dkr^\}}nd|kr@|jd\}}}|dkr|\}}n|d kr|\}}n|d kry|\}}Wn tk r|\}}YnXn^|d kr6|dkr\}}n4y|\}}Wn"tk r2|\}}YnXntd n |\}}Wn2tk r}z||\}}WYdd}~XnXj||S)Nz.htmlrrnrrr`z search?keyz getfile?keyz topic?keyzget?keyz bad pydoc url)rrn)rrn)rbrrdrJr)rZ complete_urlrropr_r) rrrrrrrrrrr get_html_page sB         z#_url_handler..get_html_pagerrztext/cssrz text/htmlz"unknown content type %r for url %s) rrar rdirnamerealpathrVr!r readlinesrt)rrrrZ path_hererrr) rrrrrrrrrrr _url_handlers,         *     rT) open_browsercCsddl}tt|}|jr&t|jdS|jrd}|r@|j|jzy^td|jt|xD|jrtd}|j }|dkr|PqZ|dkr|j|jqZt|qZWWnt t fk rtYnXWd|jr|j tdXdS)Nrz"Server commands: [b]rowser, [q]uitzServer ready atzserver> rrzServer stopped) webbrowserrrrrrrrrrrrr)rrrZ serverthreadZserver_help_msgrrrrbrowse s2    rcCst|to|jtjdkS)Nr)rr6rr sep)rNrrrispath sr cCsddl}Gdddt}dtjkrXtjjtjd}|tjkrJtjj|tjjddyp|jtjddd\}}d}d}d}d}xP|D]H\} } | d krd }d }| d krt | dS| d krd }| }| d krd }qW|r|dkrd}t ||ddS|s|x|D]} t | r4tjj |  r4t d| Py`t | rVtjj| rVt| } |rt | r~tjj| r~t| nt| n tj| Wn,tk r} zt | WYdd} ~ XnXqWWnN|j|fk rtjjtjjtjdd} t dj| tjdYnXdS)Nrc@s eZdZdS)zcli..BadUsageN)r%r&r[rrrrBadUsage sr rrrzbk:p:wFz-bTz-kz-pz-w)rzfile %r does not existapydoc - the Python documentation tool {cmd} ... Show text documentation on something. may be the name of a Python keyword, topic, function, module, or package, or a dotted reference to a class or function within a module or module in a package. If contains a '{sep}', it is used as the path to a Python source file to document. If name is 'keywords', 'topics', or 'modules', a listing of these things is displayed. {cmd} -k Search for a keyword in the synopsis lines of all available modules. {cmd} -p Start an HTTP server on the given port on the local machine. Port number 0 can be used to get an arbitrary unused port. {cmd} -b Start an HTTP server on an arbitrary unused port and open a Web browser to interactively browse documentation. The -p option can be used with the -b option to explicitly specify the server port. {cmd} -w ... Write out the HTML documentation for a module to a file in the current directory. If contains a '{sep}', it is treated as a filename; if it names a directory, documentation is written for all the contents. )rr)getoptrJrrr rargvremoveinsertrrr existsrr{rr rrrrrrrr r)r r Z scriptdirZoptsrZwritingZ start_serverrroptvalargrHrrrrcli sd        $rr)NN)r)r)rrN)rrN)r)rN)r)r)Wr3rPrTrSrZZimportlib._bootstraprZimportlib._bootstrap_externalimportlib.machineryimportlib.utilrrr r9rrrrrZ urllib.parser4r collectionsrreprlibr tracebackrrrr$r)r-r/r3r IGNORECASEr4r5r:r?rCrOrerfrwr}rrrJrrrrrrrprqrrrrrrrrrrrr.rrrrr"rrrrrrrrrr rr%rrrr$s           ' 0>*- d" ,    = %V