https://t.me/RX1948
Server : Apache
System : Linux iad1-shared-b8-43 6.6.49-grsec-jammy+ #10 SMP Thu Sep 12 23:23:08 UTC 2024 x86_64
User : dh_edsupp ( 6597262)
PHP Version : 8.2.26
Disable Function : NONE
Directory :  /lib/python3/dist-packages/trac/__pycache__/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Current File : //lib/python3/dist-packages/trac/__pycache__/loader.cpython-310.pyc
o

�k�`(�@s�ddlmZddlZddlZddlZddlmZmZmZmZddl	Z	ddl
mZddlm
Z
mZmZmZmZddlmZmZdgZdd	�Zd
d�Zdd
�Zded�e�ffdd�Zddd�Zdd�ZdS)�)�globN)�working_set�DistributionNotFound�VersionConflict�UnknownExtra)�
ComponentMeta)�get_doc�get_module_metadata�get_module_path�get_pkginfo�get_sources)�exception_to_unicode�
to_unicode�load_componentscCs |�|�dur|�|�dSdS)z@Enable the given plugin module if it wasn't disabled explicitly.N)�is_component_enabled�enable_component)�env�module�r�-/usr/lib/python3/dist-packages/trac/loader.py�_enable_plugin!s�rcsd�fdd�	}|S)z=Loader that loads any eggs on the search path and `sys.path`.Nc
s(t�t�|��\}}|D]}|tvr �j�d||j�t�|�q�fdd�}|��D]	\}}|||�q+dd�}|rAt	j
�|�}tt�
��dd�d�D]E}	�j�d	|	j|	jj�z|	jd
d�Wnty|}z||	|�||	�WYd}~qLd}~wwt	j
�t	j
�|	jj��|kr�t�|	j�qLdS)NzAdding plugin "%s" from "%s"csft|�}t|t�r�j�d||�dSt|tttf�r%�j�d||�dS�j�d|t|dd��dS)N�Skipping "%s": %sT��	traceback)	r
�
isinstancer�log�debug�ImportErrorrr�error)�item�e�ue�rrr�
_log_error4s


�z1load_eggs.<locals>._load_eggs.<locals>._log_errorcSs<|jD]}tjD]}|j|jkr|j|krt�|�qqdS)z6Remove components for `entry_point` from the registry.N)�attrsr�_components�
__module__�module_name�__name__�
deregister)�entry_point�name�crrr�deregister_componentsAs



���z<load_eggs.<locals>._load_eggs.<locals>.deregister_componentscSs|jS�N)r+)�entryrrr�<lambda>Lsz/load_eggs.<locals>._load_eggs.<locals>.<lambda>��keyzLoading plugin "%s" from "%s"T)�require)r�find_plugins�
pkg_resources�Environmentrr�location�add�items�os�path�normcase�sorted�iter_entry_pointsr+�dist�load�	Exception�dirnamerr')
r�search_path�auto_enable�
distributions�errorsr?r#r r-r/��entry_point_namer"r�
_load_eggs)sF��
�


�
�
�����zload_eggs.<locals>._load_eggsr.r)rHrIrrGr�	load_eggs's/rJcCsddd�}|S)z�Loader that look for Python source files in the plugins directories,
    which simply get imported, thereby registering them with the component
    manager if they define any components.
    Nc
Ss�|D]v}ttj�|d��}|D]h}tj�|dd��}|j�d||�z
|tjvr/t	�
||�Wn=ttfyN}z|j�
d|t|��WYd}~qd}~wttfym}z|j�
d|t|dd��WYd}~qd}~ww||krwt||�qqdS)Nz*.py���zLoading file plugin %s from %srz!Failed to load plugin from %s: %sTr)rr:r;�join�basenamerr�sys�modules�imp�load_sourcerrrr
rA�
SystemExitr)rrCrDr;�plugin_files�plugin_file�plugin_namer rrr�_load_py_files`s8�
�
��
���
���z%load_py_files.<locals>._load_py_filesr.r)rVrrr�
load_py_files[s
rWztrac.pluginscCs8|j}|g}|r|t|�7}|D]	}||||d�qdS)z:Load all plugin components found on the given search path.)rDN)�plugins_dir�list)r�
extra_path�loadersrXrC�loadfuncrrrrxs�Fc	s�i��fdd�}|j}i}tjD]�}tj|j}||�}d}tj�tj�	tj�
|j���|kr6tj�|j�}|j
|vr�d}	|rLt�|jtjtj�rLd}	t|�}
|j}|
rn|
D]}|
|dkrdd|
|<qWt|
|�|
|<qWnt|�}
|
d}|j
||j||	|
id	�||j
<||j
d
}
|j|
vr�t|�\}}||id�||j
d
|j<|jd|j}t|�\}}|}||vr�t||j�s�||�}||||�|�t|d
d�d�|
|jd|j<q|s�t|�D]
}|��dkr�|�|�q�tt|� ��dd�d�S)zAReturn package information about Trac core and installed plugins.cs�|j}t|�}��|�}|durt|�}�|<|�|�dd�d�}|dur2|�|�dd�d�}|dur?tj|d|jd�}|S)N�.�/�.pyz/__init__.py�)�project_name�versionr7)r(r
�getr�replacer5�Distribution�__file__)rr+r;�sourcesr?��path_sourcesrr�find_distribution�s
�z*get_plugin_info.<locals>.find_distributionNTF�UNKNOWNr`rb)r+rbr;�plugin_filename�readonly�inforOrO)�summary�description�
componentsr]�required)�	full_namerorp�enabledrrrq�traccSs|d��dk|d��fS)Nr+ru)�lower)�prrrr0�s
�z!get_plugin_info.<locals>.<lambda>r1)!rXrr%rNrOr&r:r;r<�realpathrBr7rMra�access�F_OK�W_OKrrbrr	r(r�
issubclass�	__class__r�getattrrYrv�popr=�iter�values)r�include_corerjrX�plugins�	componentrr?rlrmrnrb�krOrorprsr,r+rrhr�get_plugin_info�sp
�

�
��
�
�
��r�cs�dd�t|�D���fdd�}|D]1}tj�|d�dd��\}}|dkr,�r,||�qt|�D]\}}|d	�|�rA||d
<nq0qdS)z�Add a `frame_idx` element to plugin information as returned by
    `get_plugin_info()`, containing the index of the highest frame in the
    list that was located in the plugin.
    cSs&g|]\}}|d�d�r||f�qS)�filenamezbuild/)�
startswith)�.0�i�frrr�
<listcomp>�s�z+match_plugins_to_frames.<locals>.<listcomp>c	s�tj|ddd�D]<}z1|�d�}|��D]%}|�d�r:|�dd�}�D]\}}|d�|�r9||d	<WdSq$qWq	tyEYq	wdS)
Nr;T)�onlyzSOURCES.txtr_�\r^r��	frame_idx)r5�find_distributions�get_metadata�
splitlines�endswithrd�KeyError)�pluginr?rg�src�nsrcr�r���
egg_framesrr�find_egg_frame_index�s&

�

�����z5match_plugins_to_frames.<locals>.find_egg_frame_indexr;r�r^z.eggr�r�N)�	enumerater:r;�splitextrdr�)r��framesr�r��base�extr�r�rr�r�match_plugins_to_frames�s
���r�)F)rrP�os.pathr:r5rrrrrN�	trac.corer�	trac.utilrr	r
rr�trac.util.textr
r�__all__rrJrWrr�r�rrrr�<module>s$4�
V

https://t.me/RX1948 - 2025