Файловый менеджер - Редактировать - /opt/imh-python/lib/python3.9/__pycache__/pydoc.cpython-39.pyc
Ðазад
a _�h�� � @ s d Z dgZdZdZdZddlZddlZddlZddl Zddl ZddlZddlZddl Z ddlZddlZddlZddlZddlZddlZddlZddlZddlZddlmZ ddlmZ dd lmZ d d� Zdd � Zdd� Z dd� Z!dd� Z"dd� Z#dd� Z$dd� Z%dd� Z&dd� Z'dd� Z(e�)d ej*�Z+d!d"� Z,d#d$� Z-d%d&� Z.d'd(� Z/d�d)d*�Z0d+d,� Z1d-d.� Z2d/d0� Z3d1d2� Z4i fd3d4�Z5G d5d6� d6e6�Z7d7d8� Z8di fd9d:�Z9G d;d<� d<�Z:G d=d>� d>e�Z;G d?d@� d@e:�Z<G dAdB� dBe�Z=G dCdD� dDe:�Z>G dEdF� dFe>�Z?dGdH� a@dIdJ� ZAdKdL� ZBdMdN� ZCdOdP� ZDdQdR� ZEdSdT� ZFdUdV� ZGdWdX� ZHd�dYdZ�ZIe>� ZJe?� ZKe<� ZLd�d[d\�ZMd�d^d_�ZNd�d`da�ZOd�dbdc�ZPd�dedf�ZQG dgdh� dh�ZReR� ZSG didj� dj�ZTdkdl� ZUdmdn� ZVd�dpdq�ZWd�drdsdt�dudv�ZXdwdx� ZYdydz� ZZd{d|� Z[d}d~� Z\e]dk�re\� 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 }t jD ]H}tj�|pd�}tj�|�}||vrtj�|�r| �|� |�|� q| S )zAConvert sys.path into a list of absolute, existing, unique paths.�.)�sys�path�os�abspath�normcase�isdir�append)�dirsZnormdirs�dir�normdir� r �&/opt/imh-python/lib/python3.9/pydoc.py�pathdirsQ s r c C sP t j�| j�}|d u rd S | j�d�d d� D ]}t||�}q.t�|�sLd S |S )Nr ���) r �modules�get� __module__�__qualname__�split�getattr�inspect�isclass)�func�cls�namer r r � _findclass] s r c C s� t �| �rJ| jj}| j}t �|�r@tt||d �d�| ju r@|}n|j}�n$t �| �r~| j}t | �}|d u sxt||�| ur|d S n�t � | �r�| j}| j}t �|�r�|jd | | jkr�|}n|j}n�t| t �r�| j}|j}t |�}|d u s�t||�| ur�d S ntt �| ��st �| ��rj| j}| j}t||�| u�r2d S t �| ��rnt|dd �}t|t��rn||v �rn|| S nd S |jD ]F}ztt||��}W n t�y� Y �qtY n0 |d u�rt| S �qtd S )N�__func__r � __slots__)r �ismethodr! �__name__�__self__r r � __class__� isfunctionr � isbuiltinr � isinstance�property�fgetZismethoddescriptor�isdatadescriptor�__objclass__�ismemberdescriptor�dict�__mro__� _getowndoc�AttributeError)�objr �selfr r �slots�base�docr r r �_finddocg sZ � � r8 c C sd zJt �| d�}|du rW dS | turFt| �j}t|t�rF||krFW dS |W S ty^ Y dS 0 dS )zUGet the documentation string for an object if it is not inherited from its class.�__doc__N)�object�__getattribute__�typer9 r) �strr2 )r3 r7 Ztypedocr r r r1 � s r1 c C sN t | �}|du r6zt| �}W n ttfy4 Y dS 0 t|t�sDdS t�|�S )z�Get the documentation string for an object. All tabs are expanded to spaces. To clean up docstrings that are indented to line up with blocks of code, any whitespace than can be uniformly removed from the second line onwards is removed.N)r1 r8 r2 � TypeErrorr) r= r Zcleandoc)r: r7 r r r �_getdoc� s r? c C s, t | �pt�| �}|r(t�dd|�� �p*dS )z-Get the doc string or comments for an object.z^ * � )r? r Zgetcomments�re�sub�rstrip)r: �resultr r r �getdoc� s rE 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)�stripr �lenrC �join)r7 �linesr r r �splitdoc� s rM c C s"