Spamworldpro Mini Shell
Spamworldpro


Server : Apache/2.4.52 (Ubuntu)
System : Linux webserver 6.8.0-49-generic #49~22.04.1-Ubuntu SMP PREEMPT_DYNAMIC Wed Nov 6 17:42:15 UTC 2 x86_64
User : www-data ( 33)
PHP Version : 8.1.2-1ubuntu2.21
Disable Function : NONE
Directory :  /lib/python3/dist-packages/twisted/__pycache__/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Current File : //lib/python3/dist-packages/twisted/__pycache__/plugin.cpython-310.pyc
o

�b!�@s<dZddlZddlZddlZddlZddlmZmZmZm	Z	ddl
mZmZddl
mZddlmZddlmZddlmZGd	d
�d
e�ZGdd�d�ZGd
d�d�Zdd�ZzejZWneykd dd�ZYnwdd�Zdejfdd�Ze	ded�Z	d deedeejdeefdd�Z e Z!dd�Z"ddgZ#dS)!zL
Plugin system for Twisted.

@author: Jp Calderone
@author: Glyph Lefkowitz
�N)�Iterable�Optional�Type�TypeVar)�	Interface�
providedBy)�log)�getAdapterFactory)�	getModule)�namedAnyc@seZdZdZdS)�IPluginz�
    Interface that must be implemented by all plugins.

    Only objects which implement this interface will be considered for return
    by C{getPlugins}.  To be useful, plugins should also implement some other
    application-specific interface.
    N)�__name__�
__module__�__qualname__�__doc__�rr�0/usr/lib/python3/dist-packages/twisted/plugin.pyrsrc@s8eZdZdd�Zdefdd�Zdd�Zdd	d
�ZeZdS)�CachedPlugincCs*||_||_||_||_|jj�|�dS�N)�dropin�name�description�provided�plugins�append)�selfrrrrrrr�__init__'s
zCachedPlugin.__init__�returncCs&d�|j|jjd�dd�|jD���S)Nz(<CachedPlugin {!r}/{!r} (provides {!r})>z, cSsg|]}|j�qSr)r
)�.0�irrr�
<listcomp>2sz)CachedPlugin.__repr__.<locals>.<listcomp>)�formatrr�
moduleName�joinr�rrrr�__repr__.s
�zCachedPlugin.__repr__cCst|jjd|j�S)N�.)rrr"rr$rrr�load5szCachedPlugin.loadNcCsH|jD]}|�|�r|��St||d�dur!||��|�Sq|Sr)r�isOrExtendsr'r	)r�	interface�registry�default�providedInterfacerrr�__conform__8s

�zCachedPlugin.__conform__)NN)	r
rrr�strr%r'r-�getComponentrrrrr&s
	rc@seZdZdZdd�ZdS)�CachedDropina�
    A collection of L{CachedPlugin} instances from a particular module in a
    plugin package.

    @type moduleName: C{str}
    @ivar moduleName: The fully qualified name of the plugin module this
        represents.

    @type description: C{str} or L{None}
    @ivar description: A brief explanation of this collection of plugins
        (probably the plugin module's docstring).

    @type plugins: C{list}
    @ivar plugins: The L{CachedPlugin} instances which were loaded from this
        dropin.
    cCs||_||_g|_dSr)r"rr)rr"rrrrrVs
zCachedDropin.__init__N)r
rrrrrrrrr0Dsr0cCsPt|j|j�}|j��D]\}}t|d�}|dur%t|||jtt|���q|Sr)	r0r
r�__dict__�itemsrr�listr)�providerr�k�v�pluginrrr�_generateCacheEntry\s
�r8cCsi}|D]}|||<q|Srr)�keys�value�dr5rrr�fromkeysjs
r<cCs�i}t|j�}i}|��D]}|j��}||vrg||<||}|�|�q
|��D]�\}}|�d�}z |��}	|�	d��
}
t
�|
�}Wd�n1sMwYWn
ty`i}d}	Ynwd}i}
|D]7}|j
�d�d}d|
|<||vs�|j��|	kr�d}z|��}Wn
ty�t��Yqgwt|�}|||<qgt|���D]}||
vr�||=d}q�|r�z
|�t
�|��Wn*ty�}ztjd	|j|jd
�WYd}~nd}~wty�t�dd�Ynw|�|�q*|S)a;
    Compute all the possible loadable plugins, while loading as few as
    possible and hitting the filesystem as little as possible.

    @param module: a Python module object.  This represents a package to search
    for plugins.

    @return: a dictionary mapping module names to L{CachedDropin} instances.
    zdropin.cache�rNrFr&���Tz@Unable to write to plugin cache %(path)s: error number %(errno)d)r!�path�errnoz)Unexpected error while writing cache file)r
r
�iterModules�filePath�parentrr2�child�getModificationTime�open�pickler'�
BaseExceptionr�splitr�errr8r3r9�
setContent�dumps�OSError�msgr?r@�update)�module�allCachesCombined�mod�buckets�plugmod�fpp�bucket�pseudoPackagePath�
dropinPath�
lastCached�f�dropinDotCache�
needsWrite�existingKeys�pluginModule�	pluginKeyr4�entry�errr�getCacheqsr



���������rbrcCsddlm}|S)Nr)�twisted.pluginsr��packagerrr�_pluginsPackage�srf�_TInterface)�boundr)rec
csr�|durt�}t|�}|��D]&\}}|jD]}z||d�}Wn
ty-t��Yqw|dur5|VqqdS)ac
    Retrieve all plugins implementing the given interface beneath the given module.

    @param interface: An interface class.  Only plugins which implement this
    interface will be returned.

    @param package: A package beneath which plugins are installed.  For
    most uses, the default value is correct.

    @return: An iterator of plugins.
    N)rfrbr2rrHrrJ)r)re�
allDropins�keyrr7�adaptedrrr�
getPlugins�s �
����rlcs|�d���fdd�tjD�S)a�
    Return a list of additional directories which should be searched for
    modules to be included as part of the named plugin package.

    @type name: C{str}
    @param name: The fully-qualified Python name of a plugin package, eg
        C{'twisted.plugins'}.

    @rtype: C{list} of C{str}
    @return: The absolute paths to other directories which may contain plugin
        modules for the named plugin package.
    r&csJg|]!}tj�tjj|g�dg�R��stj�tjj|g��R���qS)z__init__.py)�osr?�existsr#�abspath)r�xrdrrr �s ��z&pluginPackagePaths.<locals>.<listcomp>)rI�sysr?)rrrdr�pluginPackagePaths�s


�rrr)$rrmrGrq�types�typingrrrr�zope.interfacerr�twisted.pythonr�twisted.python.componentsr	�twisted.python.modulesr
�twisted.python.reflectrrrr0r8�dictr<�AttributeErrorrb�
ModuleTyperfrgrl�
getPlugInsrr�__all__rrrr�<module>sD


�	L���
�

Spamworldpro Mini