Файловый менеджер - Редактировать - /opt/imh-python/lib/python3.9/site-packages/twisted/python/__pycache__/_pydoctor.cpython-39.pyc
Ðазад
a k�hO � @ s� d Z ddlZddlmZ ddlmZmZmZ ddlm Z G dd� de �Z dd � ZG d d� dej�Z dd � Zdd� ZG dd� dej�ZG dd� dej�ZdS )z� Support for a few things specific to documenting Twisted using pydoctor. FIXME: https://github.com/twisted/pydoctor/issues/106 This documentation does not link to pydoctor API as there is no public API yet. � N)�Optional)� astbuilder�model� zopeinterface)�SphinxInventoryc s e Zd ZdZ� fdd�Z� ZS )�TwistedSphinxInventoryz� Custom SphinxInventory to work around broken external references to Sphinx. All exceptions should be reported upstream and a comment should be created with a link to the upstream report. c sp t � �|�}|dur|S |�d�rl| j�dd�\}}|du r@dS |dkrNd}nd}|du r^dS |� d|� �S dS )a Resolve the full URL for a cross reference. @param name: Value of the cross reference. @type name: L{str} @return: A full URL for the I{name} reference or L{None} if no link was found. @rtype: L{str} or L{None} Nzzope.interface.z$zope.interface.interfaces.IInterface)NNz&zope.interface.adapter.AdapterRegistryzadapter.html�/)�super�getLink� startswithZ_links�get)�self�name�resultZbaseURL�_ZrelativeLink�� __class__� ��/root/rpmbuild/BUILDROOT/imh-python39-modules-3.9.7-92.el8.x86_64/opt/imh-python/lib/python3.9/site-packages/twisted/python/_pydoctor.pyr s �zTwistedSphinxInventory.getLink)�__name__� __module__�__qualname__�__doc__r � __classcell__r r r r r s r c C sX |D ]N}t |tj�rt�|j| �}|dv rzt| | j|�| _W q t yP Y q0 qdS )z� With a list of decorators, and the object it is running on, set the C{_deprecated_info} flag if any of the decorators are a Twisted deprecation decorator. )z#twisted.python.deprecate.deprecatedz+twisted.python.deprecate.deprecatedPropertyN) � isinstance�ast�Callr Z node2fullname�func�deprecatedToUsefulTextr Z_deprecated_info�AttributeError)r � decorators�a�fnr r r � getDeprecatedL s r# c s( e Zd Z� fdd�Z� fdd�Z� ZS )�TwistedModuleVisitorc sF t � �|� z| jjj|j }W n ty4 Y dS 0 t||j� dS )z< Called when a class definition is visited. N) r �visit_ClassDef�builder�current�contentsr �KeyErrorr# Zraw_decorators)r �node�clsr r r r% c s z#TwistedModuleVisitor.visit_ClassDefc sL t � �|� z| jjj|j }W n ty4 Y dS 0 |jrHt||j� dS )z? Called when a function definition is visited. N) r �visit_FunctionDefr&