CasperSecurity

Current Path : /lib/python3/dist-packages/twisted/python/__pycache__/
Upload File :
Current File : //lib/python3/dist-packages/twisted/python/__pycache__/_pydoctor.cpython-310.pyc

o

�bO�@s�dZddlZddlmZddlmZmZmZddlm	Z	Gdd�de	�Z
dd	�ZGd
d�dej�Z
dd
�Zdd�ZGdd�dej�ZGdd�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)�SphinxInventorycs eZdZdZ�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.
    cspt��|�}|dur|S|�d�r6|j�dd�\}}|dur dS|dkr'd}nd}|dur/dS|�d|��SdS)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.AdapterRegistryzadapter.html�/)�super�getLink�
startswith�_links�get)�self�name�result�baseURL�_�relativeLink��	__class__��:/usr/lib/python3/dist-packages/twisted/python/_pydoctor.pyr
s 
�zTwistedSphinxInventory.getLink)�__name__�
__module__�__qualname__�__doc__r
�
__classcell__rrrrrsrc	CsX|D]'}t|tj�r)t�|j|�}|dvr)z
t||j|�|_Wqt	y(YqwqdS)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�
node2fullname�func�deprecatedToUsefulTextr�_deprecated_info�AttributeError)r�
decorators�a�fnrrr�
getDeprecatedLs���r(cs(eZdZ�fdd�Z�fdd�Z�ZS)�TwistedModuleVisitorcsFt��|�z
|jjj|j}Wn
tyYdSwt||j�dS)z<
        Called when a class definition is visited.
        N)	r	�visit_ClassDef�builder�current�contentsr�KeyErrorr(�raw_decorators)r�node�clsrrrr*cs�z#TwistedModuleVisitor.visit_ClassDefcsPt��|�z
|jjj|j}Wn
tyYdSw|jr&t||j�dSdS)z?
        Called when a function definition is visited.
        N)	r	�visit_FunctionDefr+r,r-rr.r%r()rr0r!rrrr2ps��z&TwistedModuleVisitor.visit_FunctionDef)rrrr*r2rrrrrr)bs
r)cCstddlm}|jdj}t|jddt|jddd��}t|t�s'|dks'J�|||gdd	�|jd
d�D��R�S)z3
    Change an AST C{Version()} to a real one.
    r)�Version��n�sN�NEXTcss�|]}|r|jVqdS�N)r5)�.0�xrrr�	<genexpr>�s�z(versionToUsefulObject.<locals>.<genexpr>�)�incrementalr3�argsr6�getattrr�int)�versionr3�package�majorrrr�versionToUsefulObjects
 &rDcCs�ddlm}t|jd�}t|j�dkr3|jdr3t|jdtj�r,|�|jdj	�}n|jdj
}nd}|jD]}|jdkrC|j
j
}q8||||d�dS)z6
    Change a C{@deprecated} to a display string.
    r)�_getDeprecationWarningStringr4N�replacement)rF�.)�twisted.python.deprecaterErDr>�lenrr�Name�resolveName�idr6�keywords�arg�value)�visitorr�
deprecatedrErArF�keywordrrrr"�s

�r"c@seZdZeZdS)�TwistedASTBuilderN)rrrr)�ModuleVistorrrrrrS�srScs2eZdZdZeZd�fdd�	Z�fdd�Z�ZS)�
TwistedSystemz8
    A PyDoctor "system" used to generate the docs.
    Ncs$t�j|d�t|j|jd�|_dS)N)�options)�logger�project_name)r	�__init__r�msg�projectname�intersphinx)rrVrrrrY�s�zTwistedSystem.__init__csd|��dkr
tjjS|}|r,|��dkrtjjSt|tj�r'|jdkr'tjjS|j}|st	��
|�S)a
        Report the privacy level for an object.

        Hide all tests with the exception of L{twisted.test.proto_helpers}.

        param obj: Object for which the privacy is reported.
        type obj: C{model.Documentable}

        rtype: C{model.PrivacyClass} member
        ztwisted.testztwisted.test.proto_helpers�test)�fullNamer�PrivacyClass�VISIBLEr�Packager�HIDDEN�parentr	�privacyClass)r�documentabler,rrrrd�s�zTwistedSystem.privacyClassr8)	rrrrrS�defaultBuilderrYrdrrrrrrU�s
rU)rr�typingr�pydoctorrrr�pydoctor.sphinxrrr(�ZopeInterfaceModuleVisitorr)rDr"�ZopeInterfaceASTBuilderrS�ZopeInterfaceSystemrUrrrr�<module>s9
Hacker Blog, Shell İndir, Sql İnjection, XSS Attacks, LFI Attacks, Social Hacking, Exploit Bot, Proxy Tools, Web Shell, PHP Shell, Alfa Shell İndir, Hacking Training Set, DDoS Script, Denial Of Service, Botnet, RFI Attacks, Encryption
Telegram @BIBIL_0DAY