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/wiki/__pycache__/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

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

�k�`	�@s�ddlZddlmZddlTddlmZmZmZmZddl	m
Z
mZmZddl
mZddlmZddlmZGd	d
�d
e�ZdS)�N)�
ConfigSection)�*)�Element�Fragment�find_element�tag)�N_�_�tag_)�IRequestHandler)�IWikiMacroProvider)�extract_linkc@sPeZdZdZeee�dZedd�Z	dd�Z
dd�Zd	d
�Zdd�Z
d
d�ZdS)�InterTracDispatcherzInterTrac dispatcher.F�	intertraca0This section configures InterTrac prefixes. Option names in
        this section that contain a `.` are of the format
        `<name>.<attribute>`. Option names that don't contain a `.` define
        an alias.

        The `.url` attribute is mandatory and is used for locating the
        other Trac. This can be a relative path when the other Trac
        environment is located on the same server.

        The `.title` attribute is used for generating a tooltip when the
        cursor is hovered over an InterTrac link.

        Example configuration:
        {{{#!ini
        [intertrac]
        # -- Example of setting up an alias:
        t = trac

        # -- Link to an external Trac:
        genshi.title = Edgewall's Trac for Genshi
        genshi.url = https://genshi.edgewall.org
        }}}
        cCs4t�d|j�}|r|�d�r|�d�|jd<dSdS)Nz^/intertrac/(.*)��linkT)�re�match�	path_info�group�args)�self�reqr�r�5/usr/lib/python3/dist-packages/trac/wiki/intertrac.py�
match_request>s
�z!InterTracDispatcher.match_requestc
Cs�|j�dd�}|�dd�}t|�dkr+|\}}|dd�|dd�dvr+d||f}dd	lm}t|j||�|�}t|t	t
f�r[t|d
�}|durRtt
d|d���|j�d
���}	n|�|�d��}	|�|	�dS)
Nr��:r���)z""z''z%s:"%s"r)�web_context�hrefzVCan't view %(link)s. Resource doesn't exist or you don't have the required permission.)r)r�get�split�len�trac.web.chromerr
�env�
isinstancerrr�	TracErrorr	�attrib�unescaper �rstrip�redirect)
rrr�parts�resolver�targetr�	link_frag�eltr rrr�process_requestEs&
��z#InterTracDispatcher.process_requestccs�dVdS)N�	InterTracr)rrrr�
get_macros[s�
zInterTracDispatcher.get_macroscCsdtd�fS)N�messagesz+Provide a list of known InterTrac prefixes.)r)r�namerrr�get_macro_description^sz)InterTracDispatcher.get_macro_descriptionc

s�i�|j��D]6\}}|�d�}|dkr9|d|�||dd�}}��|i�}	z||	|<Wqty8Yqw|�|<q��dtd�dd���fdd	��tjd
d�t�t�	t�
td���t�	t�
td
�����fdd�t��D��S)N�.rr�traczThe Trac Projectzhttps://trac.edgewall.org)�title�urlc
3s���|}t|t�r#t�t�t�|��t�tdt�|�d���VdS|�d�}|rN|�d|�}t�t�tjt�|�|dd��t�tj||d���VdSdS)NzAlias for %(name)s)r5r:r9z	/timeline)r )	r&�strr�tr�td�strongr
r!�a)�prefixrr:r9)�
intertracsrr�generate_prefixqs"�
�
�
�
��z9InterTracDispatcher.expand_macro.<locals>.generate_prefixzwiki intertrac)�class_�Prefixz	Trac Sitecsg|]}�|��qSrr)�.0�p)rBrr�
<listcomp>�sz4InterTracDispatcher.expand_macro.<locals>.<listcomp>)�intertrac_section�options�rfind�
setdefault�	TypeErrorr	r�tabler<�th�em�sorted)
r�	formatterr5�content�key�value�idxr@�	attributerr)rBrAr�expand_macroas,
�
�
��z InterTracDispatcher.expand_macroN)�__name__�
__module__�__qualname__�__doc__�
implementsrr�is_valid_default_handlerrrHrr1r3r6rWrrrrrs
�r)r�trac.configr�	trac.core�trac.util.htmlrrrr�trac.util.translationrr	r
�trac.web.apir�
trac.wiki.apir�trac.wiki.formatterr
�	Componentrrrrr�<module>s

https://t.me/RX1948 - 2025