/snap/core18/2999/usr/lib/python3.6/__pycache__
NameSizeModeActions
abc.cpython-36.pyc75150644editdlrm
aifc.cpython-36.pyc259430644editdlrm
antigravity.cpython-36.pyc7790644editdlrm
argparse.cpython-36.pyc604560644editdlrm
ast.cpython-36.pyc117040644editdlrm
asynchat.cpython-36.pyc68150644editdlrm
asyncore.cpython-36.pyc158380644editdlrm
base64.cpython-36.pyc170590644editdlrm
bdb.cpython-36.pyc170330644editdlrm
binhex.cpython-36.pyc120860644editdlrm
bisect.cpython-36.pyc26760644editdlrm
bz2.cpython-36.pyc112820644editdlrm
calendar.cpython-36.pyc258820644editdlrm
cgi.cpython-36.pyc284160644editdlrm
cgitb.cpython-36.pyc100800644editdlrm
chunk.cpython-36.pyc49000644editdlrm
cmd.cpython-36.pyc125750644editdlrm
code.cpython-36.pyc98360644editdlrm
codecs.cpython-36.pyc339000644editdlrm
codeop.cpython-36.pyc62700644editdlrm
colorsys.cpython-36.pyc33110644editdlrm
compileall.cpython-36.pyc82780644editdlrm
configparser.cpython-36.pyc452440644editdlrm
contextlib.cpython-36.pyc111580644editdlrm
copy.cpython-36.pyc70790644editdlrm
copyreg.cpython-36.pyc42440644editdlrm
cProfile.cpython-36.pyc42940644editdlrm
crypt.cpython-36.pyc22420644editdlrm
csv.cpython-36.pyc118550644editdlrm
datetime.cpython-36.pyc545110644editdlrm
decimal.cpython-36.pyc3510644editdlrm
difflib.cpython-36.pyc596420644editdlrm
dis.cpython-36.pyc141810644editdlrm
doctest.cpython-36.pyc755890644editdlrm
dummy_threading.cpython-36.pyc11020644editdlrm
enum.cpython-36.pyc234530644editdlrm
filecmp.cpython-36.pyc83050644editdlrm
fileinput.cpython-36.pyc131520644editdlrm
fnmatch.cpython-36.pyc28740644editdlrm
formatter.cpython-36.pyc175790644editdlrm
fractions.cpython-36.pyc184260644editdlrm
ftplib.cpython-36.pyc283570644editdlrm
functools.cpython-36.pyc240620644editdlrm
genericpath.cpython-36.pyc37260644editdlrm
getopt.cpython-36.pyc62170644editdlrm
getpass.cpython-36.pyc41770644editdlrm
gettext.cpython-36.pyc143060644editdlrm
glob.cpython-36.pyc42590644editdlrm
gzip.cpython-36.pyc162260644editdlrm
hashlib.cpython-36.pyc66920644editdlrm
heapq.cpython-36.pyc142920644editdlrm
hmac.cpython-36.pyc48360644editdlrm
imaplib.cpython-36.pyc421380644editdlrm
imghdr.cpython-36.pyc41500644editdlrm
imp.cpython-36.pyc96960644editdlrm
inspect.cpython-36.pyc797390644editdlrm
io.cpython-36.pyc33870644editdlrm
ipaddress.cpython-36.pyc623860644editdlrm
keyword.cpython-36.pyc17650644editdlrm
linecache.cpython-36.pyc37780644editdlrm
locale.cpython-36.pyc340300644editdlrm
lzma.cpython-36.pyc119920644editdlrm
macpath.cpython-36.pyc56410644editdlrm
macurl2path.cpython-36.pyc18670644editdlrm
mailbox.cpython-36.pyc637520644editdlrm
mailcap.cpython-36.pyc72090644editdlrm
mimetypes.cpython-36.pyc155530644editdlrm
modulefinder.cpython-36.pyc153660644editdlrm
netrc.cpython-36.pyc38360644editdlrm
nntplib.cpython-36.pyc337800644editdlrm
ntpath.cpython-36.pyc131900644editdlrm
nturl2path.cpython-36.pyc14990644editdlrm
numbers.cpython-36.pyc121420644editdlrm
opcode.cpython-36.pyc54130644editdlrm
operator.cpython-36.pyc139130644editdlrm
optparse.cpython-36.pyc480540644editdlrm
os.cpython-36.pyc296280644editdlrm
pathlib.cpython-36.pyc420070644editdlrm
pdb.cpython-36.pyc460940644editdlrm
pickle.cpython-36.pyc426910644editdlrm
pickletools.cpython-36.pyc660200644editdlrm
pipes.cpython-36.pyc78080644editdlrm
pkgutil.cpython-36.pyc162610644editdlrm
platform.cpython-36.pyc291970644editdlrm
plistlib.cpython-36.pyc280550644editdlrm
poplib.cpython-36.pyc133290644editdlrm
posixpath.cpython-36.pyc104560644editdlrm
pprint.cpython-36.pyc158240644editdlrm
profile.cpython-36.pyc139010644editdlrm
pstats.cpython-36.pyc218570644editdlrm
pty.cpython-36.pyc38610644editdlrm
pyclbr.cpython-36.pyc83650644editdlrm
pydoc.cpython-36.pyc837750644editdlrm
py_compile.cpython-36.pyc65440644editdlrm
queue.cpython-36.pyc87550644editdlrm
quopri.cpython-36.pyc57730644editdlrm
random.cpython-36.pyc193300644editdlrm
re.cpython-36.pyc140580644editdlrm
reprlib.cpython-36.pyc54000644editdlrm
rlcompleter.cpython-36.pyc57800644editdlrm
runpy.cpython-36.pyc79820644editdlrm
sched.cpython-36.pyc65640644editdlrm
secrets.cpython-36.pyc21620644editdlrm
selectors.cpython-36.pyc176970644editdlrm
shelve.cpython-36.pyc94580644editdlrm
shlex.cpython-36.pyc69700644editdlrm
shutil.cpython-36.pyc307040644editdlrm
signal.cpython-36.pyc25150644editdlrm
site.cpython-36.pyc165600644editdlrm
sitecustomize.cpython-36.pyc2120644editdlrm
smtpd.cpython-36.pyc266830644editdlrm
smtplib.cpython-36.pyc353400644editdlrm
sndhdr.cpython-36.pyc69130644editdlrm
socket.cpython-36.pyc220130644editdlrm
socketserver.cpython-36.pyc242500644editdlrm
sre_compile.cpython-36.pyc102780644editdlrm
sre_constants.cpython-36.pyc59720644editdlrm
sre_parse.cpython-36.pyc203580644editdlrm
ssl.cpython-36.pyc369390644editdlrm
stat.cpython-36.pyc38510644editdlrm
statistics.cpython-36.pyc181740644editdlrm
string.cpython-36.pyc79640644editdlrm
stringprep.cpython-36.pyc100300644editdlrm
struct.cpython-36.pyc3120644editdlrm
subprocess.cpython-36.pyc354850644editdlrm
sunau.cpython-36.pyc169380644editdlrm
symbol.cpython-36.pyc25170644editdlrm
symtable.cpython-36.pyc104280644editdlrm
sysconfig.cpython-36.pyc159160644editdlrm
tabnanny.cpython-36.pyc69750644editdlrm
tarfile.cpython-36.pyc630850644editdlrm
telnetlib.cpython-36.pyc180970644editdlrm
tempfile.cpython-36.pyc253090644editdlrm
textwrap.cpython-36.pyc136840644editdlrm
this.cpython-36.pyc12650644editdlrm
threading.cpython-36.pyc372340644editdlrm
timeit.cpython-36.pyc116030644editdlrm
token.cpython-36.pyc33200644editdlrm
tokenize.cpython-36.pyc186470644editdlrm
trace.cpython-36.pyc194950644editdlrm
traceback.cpython-36.pyc196460644editdlrm
tracemalloc.cpython-36.pyc172290644editdlrm
tty.cpython-36.pyc10720644editdlrm
turtle.cpython-36.pyc1317510644editdlrm
types.cpython-36.pyc82010644editdlrm
typing.cpython-36.pyc733060644editdlrm
uu.cpython-36.pyc34980644editdlrm
uuid.cpython-36.pyc209180644editdlrm
warnings.cpython-36.pyc132580644editdlrm
wave.cpython-36.pyc178850644editdlrm
weakref.cpython-36.pyc191430644editdlrm
webbrowser.cpython-36.pyc157970644editdlrm
xdrlib.cpython-36.pyc83020644editdlrm
zipapp.cpython-36.pyc55340644editdlrm
zipfile.cpython-36.pyc497280644editdlrm
_bootlocale.cpython-36.pyc9800644editdlrm
_collections_abc.cpython-36.pyc287970644editdlrm
_compat_pickle.cpython-36.pyc65660644editdlrm
_compression.cpython-36.pyc41040644editdlrm
_dummy_thread.cpython-36.pyc48510644editdlrm
_markupbase.cpython-36.pyc79910644editdlrm
_osx_support.cpython-36.pyc96840644editdlrm
_pydecimal.cpython-36.pyc1634020644editdlrm
_pyio.cpython-36.pyc713860644editdlrm
_sitebuiltins.cpython-36.pyc34350644editdlrm
_strptime.cpython-36.pyc159630644editdlrm
_sysconfigdata_m_linux_x86_64-linux-gnu.cpython-36.pyc187790644editdlrm
_threading_local.cpython-36.pyc64250644editdlrm
_weakrefset.cpython-36.pyc78280644editdlrm
__future__.cpython-36.pyc41670644editdlrm
__phello__.foo.cpython-36.pyc1190644editdlrm
Edit: /snap/core18/2999/usr/lib/python3.6/__pycache__/pydoc.cpython-36.pyc (83775B)
3 Nqi@sdZdgZdZdZdZddlZddlZddlZddl Zddl Zddl Z ddl Z ddl Z ddlZddlZddlZddlZddlZddlZddlZddlZddlmZddlmZdd lmZd d Zd d ZddZddZ ddZ!ddZ"ddZ#ej$dej%Z&ddZ'ddZ(ddZ)dd Z*d!d"Z+dud#d$Z,d%d&Z-d'd(Z.d)d*Z/d+d,Z0ifd-d.Z1Gd/d0d0e2Z3d1d2Z4difd3d4Z5Gd5d6d6Z6Gd7d8d8eZ7Gd9d:d:e6Z8Gd;d<dd>e6Z:Gd?d@d@e:Z;dAdBadGdHZ?dIdJZ@dKdLZAdMdNZBdOdPZCdQdRZDdvdSdTZEe:ZFe;ZGe8ZHdwdUdVZIdxdXdYZJdydZd[ZKdzd\d]ZLd{d_d`ZMGdadbdbZNeNZOGdcddddZPdedfZQdgdhZRd|djdkZSd}dldmdndoZTdpdqZUdrdsZVeWdtkreVdS)~aGenerate Python documentation in HTML or text for interactive use. At the Python interactive prompt, calling help(thing) on a Python object documents the object, and calling help() starts up an interactive help session. Or, at the shell command line outside of Python: Run "pydoc " to show documentation on something. may be the name of a function, module, package, or a dotted reference to a class or function within a module or module in a package. If the argument contains a path segment delimiter (e.g. slash on Unix, backslash on Windows) it is treated as the path to a Python source file. Run "pydoc -k " to search for a keyword in the synopsis lines of all available modules. Run "pydoc -p " to start an HTTP server on the given port on the local machine. Port number 0 can be used to get an arbitrary unused port. Run "pydoc -b" to 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. Run "pydoc -w " to write out the HTML documentation for a module to a file named ".html". Module docs for core modules are assumed to be in /usr/share/doc/pythonX.Y/html/library if the pythonX.Y-doc package is installed or in https://docs.python.org/X.Y/library/ This can be overridden by setting the PYTHONDOCS environment variable to a different URL or to a local directory containing the Library Reference Manual pages. 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)zAConvert sys.path into a list of absolute, existing, unique paths..)syspathosabspathnormcaseisdirappend)dirsZnormdirsdirZnormdirr/usr/lib/python3.6/pydoc.pypathdirsQs   rcCs.tj|ptj|}|r*tjdd|jp,dS)z-Get the doc string or comments for an object.z^ * )inspectgetdocZ getcommentsresubrstrip)objectresultrrrr]srcCsh|jjd}t|dkr&|ddfSt|dkrZ|dj rZ|ddj|ddfSddj|fS)z>Split a doc string into a synopsis line (if any) and the rest. rrN)stripsplitlenrjoin)doclinesrrrsplitdocbs   r$cCs"|j}|j|kr|jd|}|S)z@Get a class name and qualify it with a module name if necessary.r)__name__ __module__)rmodnamenamerrr classnameks r)cCs>tj|p:tj|p:tj|p:tj|p:tj|p:tj| S)z>Check if an object is of a type that probably means it's data.)rismoduleisclass isroutineZisframeZ istracebackZiscode)rrrrisdatarsr-cGs2x,|r,|dj|j|d}|dd}qW|S)z/Do a series of global replacements on a string.rrrN)r!r)textZpairsrrrreplacexsr/cCsXt||krTtd|dd}td|d|}|d|d|t||dS|S)zCOmit part of a string if needed to make it fit in a maximum length.rrNz...)r max)r.maxlenZpreZpostrrrcrams  $r3z at 0x[0-9a-f]{6,16}(>+)$cCs tjd|S)z>Remove the hexadecimal id from a Python object representation.z\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)zo Returns True if fn is a bound method, regardless of whether fn was implemented in Python or in C. T__self__NF)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)zSplit sequence s via predicate, and return pair ([true], [false]). The return value is a 2-tuple of lists, ([x for x in s if predicate(x)], [x for x in s if not predicate(x)]) )r )s predicateZyesZnoxrrr _split_lists  rMcCs\|dkr dS|jdr$|jdr$dS|jdrrOrUrWrPrNrXrYrRrSrVrZr%r&rQrTr[) startswithendswithhasattr)r(allr9rrr visiblenamesrccCsDg}x:tj|D],\}}}}tj|r*d}|j||||fqW|S)zCWrap inspect.classify_class_attrs, with fixup for data descriptors.zdata descriptor)rclassify_class_attrsisdatadescriptorr )rresultsr(kindclsrHrrrrds  rdc s\t|dgyfddtDWntk r>iYnXfdd}|j|ddS)zGSort the attrs list in-place by _fields and then alphabetically by namer^csi|]\}}|t|qSr)r ).0ir()fieldsrr sz#sort_attributes..csj|dd|dfS)Nr)get)attr) field_orderrrsz!sort_attributes..)rGN)r< enumerate TypeErrorsort)attrsrZkeyfuncr)rorkrsort_attributess   rucCs<tjj|r8x*dD]"}tjjtjj|d|rdSqWdS)z3Guess whether a path refers to a package directory..py.pyc__init__TF)rvrw)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)z.Get the one-line summary out of a module file.NZ__temp__)loaderr)NN)r statst_mtimermr`tuple importlib machineryBYTECODE_SUFFIXESSourcelessFileLoaderEXTENSION_SUFFIXESExtensionFileLoadertokenizeopenOSErrorrutilspec_from_file_location _bootstrap_loadrmodulesrS splitlines) filenamecachemtimeZ lastupdaterZ loader_clsrrspecmodulerrrsynopsiss4      rc@s eZdZdZddZddZdS)ErrorDuringImportzEErrors that occurred while trying to import something to document it.cCs||_|\|_|_|_dS)N)rexcrHtb)r>rexc_inforrrrx(szErrorDuringImport.__init__cCs|jj}d|j||jfS)Nzproblem in %s - %s: %s)rr%rrH)r>rrrr__str__,szErrorDuringImport.__str__N)r%r&rYrSrxrrrrrr&src Cstjj}t|d}||jt|k}WdQRXtjj|}tjj |\}}|r`tj j ||}ntj j ||}tjj |||d}y tjj|St|tjYnXdS)zVszsafeimport..Nrr)rrbuiltin_module_names __import__rrrT SyntaxErrorr issubclass ImportErrorr(rr<AttributeError) r forceloadrZsubsrGrrrHrinfopartr)rr safeimportBs.     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)z%Generate documentation for an object.)risgetsetdescriptordocdataismemberdescriptorr* docmoduler+docclassr, docroutiner isinstanceproperty docpropertydocother)r>rr(argsrrrdocumentxs"       z Doc.documentcGs*d|odt|t|jf}t|dS)z+Raise an exception for unimplemented types.z.don't know how to document object%s of type %s N)reprtyper%rr)r>rr(rmessagerrrfailszDoc.failZlibz python%d.%dcCsytj|}Wntk r&d}YnXtjjd|j}tjj|}t |t tr|j dks|j |r|j tjj |d  r|j tjj |d r|j dkr|j drd|jd|j jf}qtjj ||j jd}nd}|S)z*Return the location of module docs or Nonez (built-in)rerrno exceptionsgcimpmarshalposixsignalr_thread zipimportz dist-packagesz site-packages xml.etreetest.pydoc_modhttp://https://z%s/%s/z.htmlN) rrrrrrrrrr)rr)rr)r getabsfilerrr environrmrrr rrr%r_r!rlower)r>rZbasedirrdoclocrrr getdoclocs&     z Doc.getdocloc)N)N)r%r&rYr rrmr version_inforrrrrrrrrrr!base_exec_prefixrrrrrrrs   rc@sHeZdZdZddZddZddZdd Zd d ZeZ d d Z eZ dS)HTMLReprzBClass for safely making an HTML representation of a Python object.cCs,tj|d|_|_d|_d|_|_dS)N d)rrxmaxlistmaxtuplemaxdict maxstringmaxother)r>rrrrxs  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]) rarr!r%rr<rr3r5rr)r>rLlevel methodnamerrrrepr1s  zHTMLRepr.repr1cCs^t||j}t|}d|krJdt|ddkrJd|d|j||dStjdd|j|S)Nr~z\\rrrz-((\\[\\abfnrtv\'"]|\\[0-9]..|\\x..|\\u....)+)z\1)r3rrr/rrr)r>rLrtesttestreprrrr repr_strings zHTMLRepr.repr_stringc Cs8y|jttt||jS|jd|jjSdS)Nz <%s instance>)rr3r5rr __class__r%)r>rLrrrr repr_instanceszHTMLRepr.repr_instanceN) r%r&rYrSrxrrrrrepr_strrZ repr_unicoderrrrrs rc@seZdZdZeZejZejZddZd5ddZ d6d d Z d d Z ddZ d7ddZ ddZddZddZddZddZddZdiiifdd Zd8d!d"Zd9d#d$Zddiifd%d&Zd'd(Zddiiidfd)d*Zd+d,Zd:d-d.Zd;d/d0ZdHTMLDocz'Formatter class for HTML documentation.cCs d||fS)zFormat an HTML page.z Python: %s %s r)r>titlecontentsrrrpagesz HTMLDoc.pagercCsd|||||pdfS)zFormat a page heading.a'
 
 
%s
%s
z r)r>rfgcolbgcolZextrasrrrheadings zHTMLDoc.headingN c Cs^|dkrdd|d}d|||f} |r@| d||||f} n| d|||f} | d|S) z Format a section with a heading.Nzz zz

zR z( z'
 
%s
%s %s
%s
%s%s%s
r) r>rrrrwidthZpreludeZ marginaliaZgaprrrrsectionszHTMLDoc.sectioncGsd|}|j|f|S)z$Format a section with a big heading.z%s)r)r>rrrrr bigsectionszHTMLDoc.bigsectionc Cs&|j|j}t|dddddddd S)z!Format literal preformatted text.z z rz rz
)r expandtabsr/)r>r.rrr preformats zHTMLDoc.preformatr}cCsd}t||d|}xht|D]\}|dd|}x>t|||||D]$}|t|krN||||d}qNW|d}q"Wd|S)z0Format a list of items into a multi-column list.rrzrz
zz7%s
)r range)r>listformatZcolsrrowscolrjrrr multicolumns  zHTMLDoc.multicolumncCsd|S)Nz%sr)r>r.rrrgrey&sz HTMLDoc.greycGs*x$|D]}||krd|||fSqW|S)z:Make a link for an identifier, given name-to-URL mappings.z%sr)r>r(Zdictsdictrrrnamelink(s zHTMLDoc.namelinkcCsN|jtjj|j}}t||rDt|||krDd|j|t||fSt||S)zMake a link for a class.z%s)r%rrrmr&rar<r))r>rr'r(rrrr classlink/s zHTMLDoc.classlinkcCsd|j|jfS)zMake a link for a module.z%s)r%)r>rrrr modulelink7szHTMLDoc.modulelinkcCsR|\}}}}|r|j|S|r,d||f}nd|}|rBd|}n|}d||fS)z;Make a link for a module or package to display in an index.z %s.%s.htmlz%s.htmlz"%s (package)z%s)r )r>Z modpkginfor(rr{shadowedurlr.rrr modpkglink;s   zHTMLDoc.modpkglinkcCs d||fS)zMake a link to source file.z%sr)r>rrrrrfilelinkJszHTMLDoc.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|||d d j |S)zMark up some plain text, given a context of symbols to look for. Each context dictionary maps object names to anchor names.rzD\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.%sNr) rrcompilesearchspanr groupsr/intr r!)r>r.rfuncsclassesrFrfherepatternmatchstartendrbZschemeZrfcZpepZselfdotr(rrrrmarkupNs<      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) zAProduce HTML for a class tree as given by inspect.getclasstree().rz"
rz, )z
z
%s
z
%s
)rrr r! formattree) r>treer'parentrentrycbasesparentsrIrrrr$ys    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&|d0dd kr&|dd1j}|jd j|t|d r\|jjt|j|rt| d dj|} 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 %srRz (%s)z, z-
Module Referencerz#ffffffz#7799eezindex
r|z.html#z#-z %sz

%s

rXrzPackage Contentsz#aa55cccsj|dS)Nr)r)t)r>rrrpsz#HTMLDoc.docmodule..ZModulescSsg|] \}}|qSrr)rirGrHrrrrsz%HTMLDoc.docmodule..ZClassesz#ee77aarZ Functionsz#eeaa77ZDataz#55aa55z
rNZAuthorrQZCreditsrz $Revision: rr)6r%__all__rrrr r r!rrurllibparseZquoterrrrastrr[rrrRrlocalsrr@r*r+ getmodulercrAr&rrrmr<r,r8r6r-r"rrpkgutil iter_modulesrXrsr rrr$ getclasstreerrNrQ)#r>rr(modignoredrbpartsZlinksrjZ 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|rb| r|| jn |ddt|fdd\}}tjkr|}qfn"krd}ndjj }|d7}t|| d||dd}| d||dd}| d||dd}|d||dd}|d||d d}|gksZt|}qfWd!j| } ||krd"||f}nd#|||f}|rg}x"|D]} |jj| j qW|d$d%j|}jtj}|od&|}j|d'd(| d)|S)*z.Produce HTML documentation for a class object.cs eZdZddZfddZdS)z(HTMLDoc.docclass..HorizontalRulecSs d|_dS)Nr)needone)r>rrrrxsz1HTMLDoc.docclass..HorizontalRule.__init__cs|jrdd|_dS)Nz
r)rA)r>)pushrrmaybesz.HTMLDoc.docclass..HorizontalRule.maybeN)r%r&rYrxrCr)rBrrHorizontalRulesrDrz&
Method resolution order:
z
%s
z
cst||\}}|rj|xl|D]d\}}}}yt|}Wn&tk rhj||YnXj||dq(W|S)Nr)rMrCr< Exception_docdescriptorr)msgrtrKokr(rghomeclsrH)rrhrmdictr7rrBr>rrspill#s  zHTMLDoc.docclass..spillcsNt||\}}|rJj|x&|D]\}}}}j||q(W|S)N)rMrCrF)rGrtrKrHr(rgrIrH)rJr7rBr>rrspilldescriptors5sz*HTMLDoc.docclass..spilldescriptorsc st||\}}|rj|x|D]\}}}}jt||}t|sZtj|rht|dd} nd} | dkrd|n0jt|j } d| } d|| fdq(W|S)NrSz
%s
z
%sz
%s%s
r) rMrCrr<callablerrer"rr) rGrtrKrHr(rgrIrHrIr")rrrJrKr7rrBr>rr spilldata>s"  z#HTMLDoc.docclass..spilldatacs,g|]$\}}}}t|dr||||fqS))r9)rc)rir(rgrhrH)rrrrSs z$HTMLDoc.docclass..r|-rcs |dkS)Nrr)r-) thisclassrrrplsz"HTMLDoc.docclass..z defined herezinherited from %sz:
z Methods %scSs |ddkS)Nrmethodr)r-rrrrp|szClass methods %scSs |ddkS)Nrz class methodr)r-rrrrp~szStatic methods %scSs |ddkS)Nrz static methodr)r-rrrrpszData descriptors %scSs |ddkS)Nrzdata descriptorr)r-rrrrpszData and other attributes %scSs |ddkS)Nrr<r)r-rrrrpsrz*class %sz/%s = class %sz(%s)z, z%s
 
z#000000z#ffc8d8r0)r%rAr rrgetmror rCrr&rdr<rErrpopleftrMbuiltinsrruAssertionErrorr!r"rrr)r>rr(r7rrr8realnamer)rrDmrorIrLrMrOrtrGrgrIrHanchor inheritedtagrr*r"r) rrrJrKr7rrBr>rQrrs                              zHTMLDoc.docclasscCs|jd|j|S)z)Format an argument default value as text.=)r r)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)z;Produce HTML documentation for a function or method object.rrPrz from Nz 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 ValueErrorrrr1rr r"rr)r>rr(r7rrrFrErWrYnoteskipdocsimclassrZreallinkargspecr_declr"rrrrsX       zHTMLDoc.docroutinecCsTg}|j}|r|d||jdk rB|jt||j}|d||ddj|S)Nz!
%s
z
%s
z
r)r rSr"rrr!)r>r(rHr7rfrBr"rrrrFs   zHTMLDoc._docdescriptorcCs|j|||S)z*Produce html documentation for a property.)rF)r>rr(r7rErrrrszHTMLDoc.docpropertycGs|r d|pd}||j|S)z-Produce HTML documentation for a data object.z%s = r)r)r>rr(r7r8ZlhsrrrrszHTMLDoc.docothercCs|j|||S)z1Produce html documentation for a data descriptor.)rF)r>rr(r7rErrrrszHTMLDoc.docdatacCsg}|dkri}xLtj|gD]<\}}}tdd|Drsz HTMLDoc.index..rrz#ffffffz#ee77aa)r4r5anyr rsr rr)r>rrr=r>r(r?rrrrindexs z HTMLDoc.index)r)rrNr)r})N)NN)NNN)NN)NNN)N)r%r&rYrSr_repr_instancerrrrrrrr r r rrrrr"r$rrr]rrFrrrrjrrrrrs<   +  y:   rc@s4eZdZdZddZddZddZeZdd Zd S) TextReprzAClass for safely making a text representation of a Python object.cCs,tj|d|_|_d|_d|_|_dS)Nrrr)rrxrrrrr)r>rrrrxs  zTextRepr.__init__cCsTtt|dr@ddjt|jj}t||r@t||||Sttt||j S)Nr%rr]) rarr!r%rr<r3r5rr)r>rLrrrrrr s  zTextRepr.repr1cCsHt||j}t|}d|krDdt|ddkrDd|d||dS|S)Nr~z\\rrr)r3rrr/)r>rLrrrrrrrs  zTextRepr.repr_stringc Cs,yttt||jSd|jjSdS)Nz <%s instance>)r3r5rrrr%)r>rLrrrrrszTextRepr.repr_instanceN) r%r&rYrSrxrrrrrrrrrls  rlc@seZdZdZeZejZddZdddZddZ dd d Z dd dZ d ddZ ddZ d!ddZddZd"ddZd#ddZd$ddZd S)%TextDocz'Formatter class for text documentation.cCsdjdd|DS)z(Format a string in bold by overstriking.rcss|]}|d|VqdS)Nr)rirgrrrrh.szTextDoc.bold..)r!)r>r.rrrbold,sz TextDoc.bold cs>|sdSfdd|jdD}|r4|dj|d<dj|S)z6Indent text by prepending a given prefix to each line.rcsg|] }|qSrr)rir)prefixrrr3sz"TextDoc.indent..rrrr)rrr!)r>r.rqr#r)rqrindent0s zTextDoc.indentcCs$|j|j}|j|d|dS)z&Format a section with a given heading.rz )rrrro)r>rrZclean_contentsrrrr7szTextDoc.sectionNrc sd}x|D]}t|tfkrt|\}}||t|}|rj||fkrjfdd|D} |ddj| }|d}q t|tgkr ||j|||d}q W|S)zBRender in text a class tree as returned by inspect.getclasstree().rc3s|]}t|VqdS)N)r))rir()r'rrrhFsz%TextDoc.formattree..z(%s)z, rz )rr)r!r$) r>r%r'r&rqrr'r(r)r*r)r'rr$>s  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 |d n |j |qW|j||jd d j|}g}xBtj|tjD]0\} } | jj|d r| |kr|j | qW|rJ|j||jd d j|}| rdd| 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||jd t|j"}ytj#|}Wnt$k r.d!}YnX||jd"|}|S)&z5Produce text documentation for a given module object.NAMEz - r.NzMODULE 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 DESCRIPTIONrXz (package)zPACKAGE CONTENTSrrZ SUBMODULEScSsg|] \}}|qSrr)rirGrHrrrrsz%TextDoc.docmodule..rCLASSES FUNCTIONSF)r2ZDATAr[r+r,z Revision: ZVERSIONrRZDATErNZAUTHORrQZCREDITSz (built-in)ZFILEz $Revision: rr)%r%r$rrr<rrr@r+r3rcr r,r8r-setrar4r5rXaddrsr!r*r_r$r6rrr1r[rrRrNrQrrr)r>rr(r7ZsynopdescrrbrrrGrHrr<r=Z modpkgs_namesr>r'r?Z submodulesr@rr;rrrrrNs           $    zTextDoc.docmodulecsfj}|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|r0| rT| j n |ddt|fdd\}}tjkr|}q>n krd}ndtj}t||d||dd}|d||dd}|d||d d}|d!||d"d}|d#||d$d}|gks(t|}q>Wdj| } | sJ|dS|dj| jd%dS)&z4Produce text documentation for a given class object.cSs 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)rA)r>rrrrxsz1TextDoc.docclass..HorizontalRule.__init__cs|jrddd|_dS)NrPrvr)rA)r>)rBrrrCs z.TextDoc.docclass..HorizontalRule.maybeN)r%r&rYrxrCr)rBrrrDsrDcst||\}}|rj|x^|D]V\}}}}yt|}Wn&tk rhj||Yq(Xj||q(W|S)N)rMrCr<rErFr)rGrtrKrHr(rgrIrH)rJr7rrBr>rrrLszTextDoc.docclass..spillcsNt||\}}|rJj|x&|D]\}}}}j||q(W|S)N)rMrCrF)rGrtrKrHr(rgrIrH)rJr7rBr>rrrMsz*TextDoc.docclass..spilldescriptorsc st||\}}|rj|x~|D]v\}}}}t|sFtj|rPt|}nd}yt|} Wntk r|j|} YnXj | |d|ddq(W|S)Nrv)r2r"r) rMrCrNrrerr<r__dict__r) rGrtrKrHr(rgrIrHr"r9)rJr7rrBr>rrrOs  z#TextDoc.docclass..spilldatacs,g|]$\}}}}t|dr||||fqS))r9)rc)rir(rgrhrH)rrrrs z$TextDoc.docclass..rcs |dkS)Nrr)r-)rQrrrpsz"TextDoc.docclass..z defined herezinherited from %sz Methods %s: cSs |ddkS)NrrRr)r-rrrrpszClass methods %s: cSs |ddkS)Nrz class methodr)r-rrrrp szStatic methods %s: cSs |ddkS)Nrz static methodr)r-rrrrp"szData descriptors %s: cSs |ddkS)Nrzdata descriptorr)r-rrrrp$szData and other attributes %s: cSs |ddkS)Nrr<r)r-rrrrp&sz | )r%rAr&romapr!rr rrrSr rdrTrMrUrr)rurVrrr)r>rr(r7r8rWr)rzrr*r"rrXrIrDrLrMrOrtrZr[r)rJr7rrBr>rQrrsn                        zTextDoc.docclasscCsd|j|S)z)Format an argument default value as text.r\)r)r>rrrrr]0szTextDoc.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 | } |d kr|j|d } | dd } | s&d } | | |} |r@| d St |pLd} | d | oj|j| jd SdS)z;Produce text documentation for a function or method object.rrz from Nz method of %s instancez unbound %s methodrz = zz lambda z(...)rr)r%r?r;rr)rorr^r,r_r`rrr1rrrr)r>rr(r7rErWrarbrcrrdr_rer"rrrr4sH       zTextDoc.docroutinecCsTg}|j}|r$||j||dt|p.d}|rJ||j||ddj|S)Nrr)r rorrrr!)r>r(rHr7rfrBr"rrrrFes zTextDoc._docdescriptorcCs|j|||S)z*Produce text documentation for a property.)rF)r>rr(r7rErrrrrszTextDoc.docpropertycCs|j|||S)z1Produce text documentation for a data descriptor.)rF)r>rr(r7rErrrrvszTextDoc.docdatac Cs|j|}|rF|r|dpd|}|t|} | dkrF|d| d}|rX|j|dpZd|}|dk r~|d|jt|7}|S)z-Produce text documentation for a data object.z = rrNz...r)rr rorrr1) r>rr(r7r&r2r"rrZchoprrrrzs  zTextDoc.docother)rp)Nr)NN)NN)NNN)NNN)NNN)NNNNN)r%r&rYrSrlrkrrorrrr$rrr]rrFrrrrrrrrm$s   e } 1  rmc@seZdZdZddZdS) _PlainTextDocz2Subclass of TextDoc which overrides string stylingcCs|S)Nr)r>r.rrrrosz_PlainTextDoc.boldN)r%r&rYrSrorrrrr}sr}cCstat|dS)zCThe first time this is called, determine what kind of pager to use.N)getpagerpager)r.rrrrsrc s`ttjdstSttjds tStjj s8tjj r.ZTERMdumbemacscstt|S)N) pipepagerr)r.)rrrrpscs t|S)N)r)r.)rrrrpscSstt|dS)Nzmore <)rr)r.rrrrpssystemz(pager) 2>/dev/nullrcSs t|dS)Nr)r)r.rrrrpsz(less) 2>/dev/nullcSs t|dS)NZless)r)r.rrrrpsNz more "%s"cSs t|dS)NZmore)r)r.rrrrps)rr)rr)rarstdin plainpagerstdoutrr rrmplatformrtempfileZmkstempclosettypagerunlink)rfdrr)rrr~s:          r~cCstjdd|S)z%Remove boldface formatting from text.z.r)rr)r.rrrrsrc Csddl}|j|d|jd}yDtj|jdd*}y|j|Wntk rPYnXWdQRXWntk rrYnXx(y|j PWqvtk rYqvXqvWdS)z3Page through text by feeding it to another program.rNT)shellrbackslashreplace)errors) subprocessPopenPIPEio TextIOWrapperrwriteKeyboardInterruptrwait)r.cmdrprocpiperrrrs rcCs`ddl}|j}t|ddd}|j|WdQRXztj|d|dWdtj|XdS)z.cSstjjddddS)Nrr)rrrrrrrrpsZLINESrz -- more --qQz  bB)rr)rr)rrr)rrrttyrrfilenoZ tcgetattrZ setcbreakrrrUnsupportedOperationrr rrmr`rrr!flushZ tcsetattrZ TCSAFLUSH) r.r#rroldZgetcharhrZincr(rrrrsL              &rcCstjjtt|dS)z>Simply print unformatted text. This is the ultimate fallback.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) z/Produce a short description of the given thing.zbuilt-in module rXzpackage zmodule zbuilt-in function zgetset descriptor %s.%s.%szmember descriptor %s.%s.%szclass z function zmethod )rr*r%rrrar8r __objclass__r&rr+r6r7r)thingrrrdescribes.                    rc Csdd|jdD}d\}}xB|t|kr^tdj|d|d|}|rZ||d}}qPqW|rj|}nt}x8||dD](}yt||}Wq|tk rdSXq|W|S)z@Locate an object by name or dotted path, importing as necessary.cSsg|] }|r|qSrr)rirrrrr/szlocate..rNrr)Nr)rr rr!rUr<r)rrr9rnZ nextmodulerrrrrlocate-s  rcCsVt|tr0t||}|dkr(td|||fSt|dd}|t|trL|ndfSdS)zDGiven an object or a path to an object, get the object and its name.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%)rr1rrr<)rrrr(rrrresolveFs    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)zBRender text documentation, given an object or a path to an object.Nrz in z in module z objectz )r.rrrr3rfindr%r*r+r,rrrrrr)rrrZrendererrr(ryrrrr render_docTs$         rcCsfy2|dkrtt|||n|jt|||tWn.ttfk r`}zt|WYdd}~XnXdS)zCDisplay text documentation, given an object or a path to an object.N)rrr plaintextrrprint)rrroutputrHrrrr"ms r"cCsy`t||\}}tjt|tj||}t|dddd}|j|WdQRXtd|dWn.tt fk r}zt|WYdd}~XnXdS)zr'r?rrr writedocss  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 COMPARISONlambdarunonlocalglobal NAMESPACESpassraise EXCEPTIONSreturnwhilebreak continue if TRUTHVALUE CONTEXTMANAGERS EXCEPTIONS yieldyield)!FalseNoneTrueandasrrrrdefrelifrexceptfinallyrfromrrrrisrrnotorrrrrrrrcCsg|]}dD] }||q qS)'r)rrr)riprrrrrszHelper.rfrur'''r"""+rP***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...:@r~r]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 typesmappingDICTIONARYLITERALSr DICTIONARIES LITERALSattribute-references(getattr hasattr setattr ATTRIBUTEMETHODS subscriptionsslicingscallspowerunarybinaryshiftingbitwise comparisonsEXPRESSIONS BASICMETHODSbooleansEXPRESSIONS TRUTHVALUE assignmentr augassign NUMBERMETHODScompoundfor while break continuetruth if while and or not BASICMETHODSdebuggerpdbcontext-managers)Ir@rZ STRINGMETHODSZ FORMATTINGUNICODEZNUMBERSZINTEGERZFLOATrrfZMAPPINGSruZMETHODSZ CODEOBJECTSZ TYPEOBJECTSZ FRAMEOBJECTSZ TRACEBACKSZNONErZSPECIALATTRIBUTESrtrZPACKAGESrIrZ PRECEDENCEZOBJECTSZSPECIALMETHODSrZATTRIBUTEMETHODSZCALLABLEMETHODSrZMAPPINGMETHODSrZ EXECUTIONr]ZDYNAMICFEATURESZSCOPINGZFRAMESrZ CONVERSIONSZ IDENTIFIERSZSPECIALIDENTIFIERSrZLITERALSZTUPLESZ TUPLELITERALSZLISTSrjr7rnZ ATTRIBUTESZ SUBSCRIPTSrCZCALLSrrZBINARYZSHIFTINGrrrZ ASSERTIONZ ASSIGNMENTrZDELETIONZ RETURNINGZ IMPORTINGZ CONDITIONALZLOOPINGrZ DEBUGGINGZCONTEXTMANAGERSNcCs||_||_dS)N)_input_output)r>inputrrrrrx7szHelper.__init__cCs |jp tjS)N)rrr)r>rrrrp;szHelper.cCs |jp tjS)N)rrr)r>rrrrp<scCs2tjdddkr|dSd|jj|jjfS)Nrr0?rz<%s.%s instance>)rstackrr&rY)r>rrr__repr__>s 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__Fs   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>rrrrrSs"  ,   zHelper.interactcCs8|jtjkrt|S|jj||jj|jjSdS)z.Read one line, using input() when appropriate.N)rrrrrrr)r>Zpromptrrrrhs    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 showtopicrrr1rrrr)r>rrrrrqs6        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)rrrrr)r>rrrrsz Helper.intror}Pc Cstt|}||}t||d|}xt|D]z}xht|D]\}|||}|t|kr@|jj||||dkr@|jjdd|dt||q@W|jjdq2WdS)Nrrr)rsortedr rrr) r>itemscolumnsrZcolwrrowr rjrrrrs    (z Helper.listcCs |jjd|j|jjdS)NzN Here is a list of the Python keywords. Enter any keyword to get more help. )rrrrrD)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. )rrrrrD)r>rrrrszHelper.listsymbolscCs |jjd|j|jjdS)NzN Here is a list of available topics. Enter any topic name to get more help. )rrrrrD)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.topicsrrrrrmrrrrKeyErrorrtextwrapr!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)a*Return unbuffered tuple of (topic, xrefs). If an error occurs here, the exception is caught and displayed by the url handler. This function duplicates the showtopic method but returns its result directly so it can be formatted for display in an html page. rNt Sorry, topic and keyword documentation is not available because the module "pydoc_data.topics" could not be found. rzcould not find topicr)rr) rrrrmrr`rr1 _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'ryrrrrcallbacksz$Helper.listmodules..callbackcsd|ddS)Nr)r')rrronerror sz#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". )rrrapropos ModuleScannerrunrrD)r>rGrrr)rrrs    zHelper.listmodules)rr)rr)rr)rr)rr)rr)rr)rr)rr)rr)rr)rr)rru)rr)rr)rr)rru)rr)rr)rr)rr)rrrr)rrrr)rrPrrrrrrrrrrrrrrrrrr)rrrrrrr)rPr) rr r r r r rrrrrr)rrrrrr)rr)r%r&)r'r()r)r*)r+r)r'r,)r-r.)r/r0)r1r2)r3r4)r5r6)r8r9)r:r;)r<r=)r>r?)rAr)rBrC)rDr)r%rE)rFr)rGrH)rJr@)rKrL)rMrN)rOrP)rQrR)rSrT)rSrU)rVrW)rXrY)rZr[)r\r)rr^)r_r)r`ra)rbr)rcr)rdre)rgrh)rirj)rkrl)rmrn)r ro)rprq)rrr)rsr)rtrI)rurI)rvrI)rwrI)rxrI)ryrI)rzr{)r|r})r~r)rr)rr)rr)rr)rr)NN)r}r)r)r)r)!r%r&rYrZ _strprefixesZ_symbols_inverserrrZsymbols_rrmrrxrrrrrrrrrrrrrrrrrrrrrrrrs6              rc@seZdZdZdddZdS)rz7An interruptible scanner that searches module synopses.NcCs |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_filenamerT)rrrrrrSrrr4r _get_specrrrarrErrStringIOrrrrrrr<)r>rrGZ completerrseenr'r(ryr>r?rrsourcerrrrrrs`       zModuleScanner.run)NNN)r%r&rYrSrrrrrrsrc CsDdd}dd}tj"tjdtj|||dWdQRXdS)zAPrint all the one-line module summaries that contain a substring.cSs6|dddkr |ddd}t||o.d|dS)Nrz .__init__z (package)z- ii)r)rr'ryrrrrWszapropos..callbackcSsdS)Nr)r'rrrr[szapropos..onerrorignore)rN)warningscatch_warningsfilterwarningsrr)rGrrrrrrUs   rcsddlddlddlddlGdddjjGfdddjjGfdddj}|||}|jx|j r|j rt j d q~W|S) a7Start an HTTP server thread on a specific port. Start an HTML/text server thread, so HTML or text documents can be browsed dynamically and interactively with a Web browser. Example use: >>> import time >>> import pydoc Define a URL handler. To determine what the client is asking for, check the URL and content_type. Then get or generate some text or HTML code and return it. >>> def my_url_handler(url, content_type): ... text = 'the URL sent was: (%s, %s)' % (url, content_type) ... return text Start server thread on port 0. If you use port 0, the server will pick a random port number. You can then use serverthread.port to get the port number. >>> port = 0 >>> serverthread = pydoc._start_server(my_url_handler, port) Check that the server is really started. If it is, open browser and get first page. Use serverthread.url as the starting page. >>> if serverthread.serving: ... import webbrowser The next two lines are commented out so a browser doesn't open if doctest is run on this module. #... webbrowser.open(serverthread.url) #True Let the server do its thing. We just need to monitor its status. Use time.sleep so the loop doesn't hog the CPU. >>> starttime = time.time() >>> timeout = 1 #seconds This is a short timeout for testing purposes. >>> while serverthread.serving: ... time.sleep(.01) ... if serverthread.serving and time.time() - starttime > timeout: ... serverthread.stop() ... break Print any errors that may have occurred. >>> print(serverthread.error) None rNc@seZdZddZddZdS)z!_start_server..DocHandlercSsX|jjdrd}nd}|jd|jdd||j|jj|j|j|jddS) zProcess a request from an HTML browser. The URL received is in self.path. Get an HTML page from self.urlhandler and send it. z.cssztext/cssz text/htmlz Content-Typez%s; charset=UTF-8zutf-8N) rr`Z 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&rYrrrrrr DocHandlersrcs(eZdZddZfddZddZdS)z _start_server..DocServercSs6d|_|j|f|_||_|jj||j|jd|_dS)NZ localhostF)hostZaddressrrIrxhandlerr)r>portrrrrrxs  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&rYrxrrr)rrr DocServers rcs:eZdZfddZfddZddZddZd S) z#_start_server..ServerThreadcs,||_t||_jj|d|_d|_dS)NF)rrrThreadrxservingerror)r>rr) threadingrrrxs   z,_start_server..ServerThread.__init__cstyFjj__jj_t|j_|j |j }||_ |j Wn(t k rn}z ||_WYdd}~XnXdS)zStart the server.N)server HTTPServerrIrrZMessageZ MessageClass staticmethodrrready docserverrrEr)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)z&Stop the server and this thread nicelyTNF)rrr!rr)r>rrrstops z(_start_server..ServerThread.stopN)r%r&rYrxrrrr)rrrrrrr ServerThreads  rg{Gz?) Z http.serverZ email.messagerrrZBaseHTTPRequestHandlerrrr rrtimeZsleep)rrrZthreadr)rrrrrrr _start_servercs8& r text/htmlc sGfdddt}|fddfddfddfd d fd d fd dfddfddfdd}|jdr|dd}|dkrtjjtjjt}tjj||}t|}dj|j SQRXn|dkr||St d||fdS)aThe pydoc url handler for use with the pydoc server. If the content_type is 'text/css', the _pydoc.css style sheet is read and returned if it exits. If the content_type is 'text/html', then the result of get_html_page(url) is returned. cseZdZfddZdS)z_url_handler.._HTMLDoccsd}d|}d|||fS)zFormat an HTML page.zpydoc_data/_pydoc.cssz1a  Pydoc: %s %s%s
%s
r)r>rrcss_pathZcss_link) html_navbarrrr sz#_url_handler.._HTMLDoc.pageN)r%r&rYrr)rrr_HTMLDoc srcs>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)zModule Index page.cSs d||fS)Nz%sr)r(rrr bltinlink3 sz3_url_handler..html_index..bltinlinkz7Index of Modulesz#ffffffz#7799eecSsg|]}|dkr|qS)rr)rir(rrrr9 sz4_url_handler..html_index..z

zBuilt-in Modulesz#ee77aaz|

pydoc by Ka-Ping Yee<ping@lfw.org>zIndex of Modulesr) rrrr rrr rjr!)rrnamesrrr)rrr html_index0 s  z _url_handler..html_indexc sgfdd}tj*tjddd}tj|||dWdQRXdd }g}jd d d }x"D]\}}|j|||qhW|jd |d ddj|}d|fS)zSearch results page.cs:|dddkr |ddd}j||o0d|fdS)Nrz .__init__z (package)z- ii)r )rr'ry) search_resultrrrN sz3_url_handler..html_search..callbackrcSsdS)Nr)r'rrrrU sz2_url_handler..html_search..onerror)rNcSs d||fS)Nz%sr)r(rrrrZ sz4_url_handler..html_search..bltinlinkz5Search Resultsz#ffffffz#7799eezkey = %sz#ee77aaz
zSearch Results) rrrrrrr rr!) rGrrrrfrr(ryr)r)rr html_searchI s    z!_url_handler..html_searchcsLdd}jddd}ttjj}j||}|jddd|}d|fS)zIndex of topic texts available.cSs d||fS)Nz%sr)r(rrrrj sz4_url_handler..html_topics..bltinlinkz,INDEXz#ffffffz#7799eeZTopicsz#ee77aa)rrrrrDr r)rrrr)rrr html_topicsg s z!_url_handler..html_topicscsLjddd}ttjj}dd}j||}|jddd|}d|fS)zIndex of keywords.z,INDEXz#ffffffz#7799eecSs d||fS)Nz%sr)r(rrrr~ sz6_url_handler..html_keywords..bltinlinkZKeywordsz#ee77aa)rrrrrDr r)rrrr)rrr html_keywordsw 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) zTopic or keyword help page.ZKEYWORDZTOPICz)%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)rr`rr)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)rir)rrrrh sz3_url_handler..html_error..z#bb0000z Error - %s)rr!rrr)rrrr)rrr html_error s z _url_handler..html_errorcst|}|jdr|dd }y|dkr4\}}n|dkrH\}}n|dkr\\}}nd|kr&|jd\}}}|d kr|\}}n|d kry|\}}Wn tk r|\}}YnXn\|d kr|dkr\}}n4y|\}}Wn"tk r|\}}YnXntd n |\}}Wn2tk rf}z||\}}WYdd}~XnXj||S)zGenerate an HTML page for url.z.htmlNrrjrrr\z search?keyz topic?keyzget?keyz bad pydoc url)rrj)rrj)r`rr`rEr)rZ complete_urlrropr]r)rrrrrrrrrr get_html_page s>         z#_url_handler..get_html_pagerrNztext/cssrz text/htmlz"unknown content type %r for url %s) rr_r rdirnamerealpathrTr!r readlinesrr)rrrrZ path_hererfpr) rrrrrrrrrr _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) zStart the enhanced pydoc Web server and open a Web browser. Use port '0' to start the server on an arbitrary port. Set open_browser to False to suppress opening a browser. rNz"Server commands: [b]rowser, [q]uitzServer ready atzserver> rrzServer stopped) webbrowserrrrrrrrrrrrr)rrrZ serverthreadZserver_help_msgrrrrbrowse s2    rcCst|to|jtjdkS)Nr)rr1rr sep)rLrrrispath srcCsddl}Gdddt}dtjkrXtjjtjd}|tjkrJtjj|tjjddyp|jtjddd\}}d }d }d }d}xP|D]H\} } | d krd }d }| d krt | dS| d krd }| }| dkrd }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)z@Command-line interface (looks at sys.argv to decide what to do).rNc@s eZdZdS)zcli..BadUsageN)r%r&rYrrrrBadUsage srrrrzbk: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)getoptrErrr rargvremoveinsertrrrexistsrryrr rrrrrrrrr)rrZ scriptdirZoptsrZwritingZ start_serverrrZoptvalargrHrrrrcli sd        $r r)NN)r)r)rrN)rrN)r)rN)r)r)XrSr.rNrRrQrUZimportlib._bootstraprimportlib._bootstrap_externalimportlib.machineryimportlib.utilrrr r4rrrrrZ urllib.parser/r collectionsrreprlibr tracebackrrrr$r)r-r/r3r IGNORECASEr4r5r:r?rCrMrcrdrur{rrrErrrrrrrlrmr}rr~rrrrrrrrr.rrrrr"rrrrrrrrrrr r%rrrr(s           ' 0?*- d$ ,    = n%V