관리-도구
편집 파일: pydoc.cpython-37.pyc
B � f�� � @ s d Z dgZdZdZdZddlZddlZddlZddl Zddl ZddlZddlZddl Z ddlZddlZddlZddlZddlZddlZddlZddlZddlZddlmZ ddlmZ dd lmZ d d� Zdd � Zdd� Z dd� Z!dd� Z"dd� Z#dd� Z$e�%dej&�Z'dd� Z(dd� Z)dd� Z*dd � Z+d!d"� Z,dzd#d$�Z-d%d&� Z.d'd(� Z/d)d*� Z0d+d,� Z1i fd-d.�Z2G d/d0� d0e3�Z4d1d2� Z5di fd3d4�Z6G d5d6� d6�Z7G d7d8� d8e�Z8G d9d:� d:e7�Z9G d;d<� d<e�Z:G d=d>� d>e7�Z;G d?d@� d@e;�Z<dAdB� a=dCdD� Z>dEdF� Z?dGdH� Z@dIdJ� ZAdKdL� ZBdMdN� ZCdOdP� ZDdQdR� ZEd{dSdT�ZFe;� ZGe<� ZHe9� ZId|dUdV�ZJd}dXdY�ZKd~dZd[�ZLdd\d]�ZMd�d_d`�ZNG dadb� db�ZOeO� ZPG dcdd� dd�ZQdedf� ZRdgdh� ZSd�djdk�ZTd�dldmdn�dodp�ZUdqdr� ZVdsdt� ZWdudv� ZXdwdx� ZYeZdyk�r�eY� dS )�a Generate 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 <name>" to show documentation on something. <name> 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 <keyword>" to search for a keyword in the synopsis lines of all available modules. Run "pydoc -n <hostname>" to start an HTTP server with the given hostname (default: localhost) on the local machine. Run "pydoc -p <port>" 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. Combine with the -n and -p options to control the hostname and port used. Run "pydoc -w <name>" to write out the HTML documentation for a module to a file named "<name>.html". Module docs for core modules are assumed to be 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 <ping@lfw.org>z26 February 2001z�Guido 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_onlyc C s` g } g }xRt jD ]H}tj�|p d�}tj�|�}||krtj�|�r| �|� |�|� qW | S )zAConvert sys.path into a list of absolute, existing, unique paths.�.)�sys�path�os�abspath�normcase�isdir�append)�dirsZnormdirs�dirZnormdir� r �*/opt/alt/python37/lib64/python3.7/pydoc.py�pathdirsP s r c C s. t �| �pt �| �}|r*t�dd|�� �p,dS )z-Get the doc string or comments for an object.z^ * � )�inspect�getdocZgetcomments�re�sub�rstrip)�object�resultr r r r \ s r c C sf | � � �d�}t|�dkr&|d dfS t|�dkrX|d �� sX|d d�|dd� �fS dd�|�fS )z>Split a doc string into a synopsis line (if any) and the rest.� � r r � N)�strip�split�lenr �join)�doc�linesr r r �splitdoca s r$ c C s"