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

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

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

�k�`�~�@sXddlZddlZddlZddlmZddlmZddlmZmZm	Z	m
Z
mZmZddl
TddlmZmZmZddlmZddlmZmZmZdd	lmZmZdd
lmZddlmZmZddl m!Z!m"Z"m#Z#m$Z$m%Z%dd
l&m'Z'm(Z(Gdd�de)�Z*Gdd�de+�Z,Gdd�de+�Z-Gdd�de+�Z.Gdd�de+�Z/Gdd�de0�Z1ej2ddd��Z3dS)�N)�datetime)�cached)�
BoolOption�
ConfigSection�	IntOption�
ListOption�Option�OrderedExtensionsOption)�*)�IPermissionRequestor�PermissionCache�PermissionSystem)�IResourceManager)�Ranges�as_bool�as_int)�
parse_date�	user_time)�tag)�shorten_line�
to_unicode)�_�N_�
deactivate�gettext�
reactivate)�IWikiSyntaxProvider�
WikiParsercsTeZdZdZdgZ�fdd�Z�fdd�Zddd	�Zd
d�Zdd
�Z	dd�Z
�ZS)�TicketFieldListz4Improved ticket field list, allowing access by name.�_mapcs t�j|�dd�|D�|_dS)NcSsi|]}|d|�qS��name���.0�valuer"r"�1/usr/lib/python3/dist-packages/trac/ticket/api.py�
<dictcomp>+sz,TicketFieldList.__init__.<locals>.<dictcomp>)�super�__init__r)�self�args��	__class__r"r&r))szTicketFieldList.__init__cst��|�||j|d<dS)Nr!)r(�appendr)r*r%r,r"r&r.-szTicketFieldList.appendNcCs|j�||�S�N)r�get)r*r!�defaultr"r"r&�by_name1szTicketFieldList.by_namecCst|�Sr/�r�r*r"r"r&�__copy__4szTicketFieldList.__copy__cst�fdd�|D��S)Nc3s�|]	}t�|��VqdSr/)�copy�deepcopyr#��memor"r&�	<genexpr>8s�z/TicketFieldList.__deepcopy__.<locals>.<genexpr>r3)r*r9r"r8r&�__deepcopy__7szTicketFieldList.__deepcopy__cCs
||jvSr/)r)r*r!r"r"r&�__contains__:s
zTicketFieldList.__contains__r/)�__name__�
__module__�__qualname__�__doc__�	__slots__r)r.r2r5r;r<�
__classcell__r"r"r,r&r%s
rc@�8eZdZdZdd�Zdd�Zdd�Zdd	�Zd
d�ZdS)
�ITicketActionControllerz�Extension point interface for components willing to participate
    in the ticket workflow.

    This is mainly about controlling the changes to the ticket ''status'',
    though not restricted to it.
    cC�dS)aiReturn an iterable of `(weight, action)` tuples corresponding to
        the actions that are contributed by this component. The list is
        dependent on the current state of the ticket and the actual request
        parameter.

        `action` is a key used to identify that particular action.
        (note that 'history' and 'diff' are reserved and should not be used
        by plugins)

        The actions will be presented on the page in descending order of the
        integer weight. The first action in the list is used as the default
        action.

        When in doubt, use a weight of 0.
        Nr"��req�ticketr"r"r&�get_ticket_actionsF�z*ITicketActionController.get_ticket_actionscCrE)aReturns an iterable of all the possible values for the ''status''
        field this action controller knows about.

        This will be used to populate the query options and the like.
        It is assumed that the terminal status of a ticket is 'closed'.
        Nr"r"r"r"r&�get_all_statusWrJz&ITicketActionController.get_all_statuscCrE)a�Return a tuple in the form of `(label, control, hint)`

        `label` is a short text that will be used when listing the action,
        `control` is the markup for the action control and `hint` should
        explain what will happen if this action is taken.

        This method will only be called if the controller claimed to handle
        the given `action` in the call to `get_ticket_actions`.

        Note that the radio button for the action has an `id` of
        `"action_%s" % action`.  Any `id`s used in `control` need to be made
        unique.  The method used in the default ITicketActionController is to
        use `"action_%s_something" % action`.
        Nr"�rGrH�actionr"r"r&�render_ticket_action_control_rJz4ITicketActionController.render_ticket_action_controlcCrE)aLReturn a dictionary of ticket field changes.

        This method must not have any side-effects because it will also
        be called in preview mode (`req.args['preview']` will be set, then).
        See `apply_action_side_effects` for that. If the latter indeed triggers
        some side-effects, it is advised to emit a warning
        (`trac.web.chrome.add_warning(req, reason)`) when this method is called
        in preview mode.

        This method will only be called if the controller claimed to handle
        the given `action` in the call to `get_ticket_actions`.
        Nr"rLr"r"r&�get_ticket_changesorJz*ITicketActionController.get_ticket_changescCrE)a�Perform side effects once all changes have been made to the ticket.

        Multiple controllers might be involved, so the apply side-effects
        offers a chance to trigger a side-effect based on the given `action`
        after the new state of the ticket has been saved.

        This method will only be called if the controller claimed to handle
        the given `action` in the call to `get_ticket_actions`.
        Nr"rLr"r"r&�apply_action_side_effects}rJz1ITicketActionController.apply_action_side_effectsN)	r=r>r?r@rIrKrNrOrPr"r"r"r&rD>srDc@rC)
�ITicketChangeListenerzvExtension point interface for components that require notification
    when tickets are created, modified, or deleted.cCrE)z Called when a ticket is created.Nr"�rHr"r"r&�ticket_created�rJz$ITicketChangeListener.ticket_createdcCrE)z�Called when a ticket is modified.

        `old_values` is a dictionary containing the previous values of the
        fields that have changed.
        Nr")rH�comment�author�
old_valuesr"r"r&�ticket_changed�rJz$ITicketChangeListener.ticket_changedcCrE)z Called when a ticket is deleted.Nr"rRr"r"r&�ticket_deleted�rJz$ITicketChangeListener.ticket_deletedcCrE)z)Called when a ticket comment is modified.Nr")rH�cdaterUrT�old_commentr"r"r&�ticket_comment_modified�rJz-ITicketChangeListener.ticket_comment_modifiedcCrE)z�Called when a ticket change is deleted.

        `changes` is a dictionary of tuple `(oldvalue, newvalue)`
        containing the ticket change of the fields that have changed.Nr")rHrY�changesr"r"r&�ticket_change_deleted�rJz+ITicketChangeListener.ticket_change_deletedN)	r=r>r?r@rSrWrXr[r]r"r"r"r&rQ�srQc@�(eZdZdZdd�Zdd�Zdd�ZdS)	�ITicketManipulatorz7Miscellaneous manipulation of ticket workflow features.cCrE)zNNot currently called, but should be provided for future
        compatibility.Nr")rGrH�fields�actionsr"r"r&�prepare_ticket�rJz!ITicketManipulator.prepare_ticketcCrE)aValidate ticket properties when creating or modifying.

        Must return a list of `(field, message)` tuples, one for each problem
        detected. `field` can be `None` to indicate an overall problem with the
        ticket. Therefore, a return value of `[]` means everything is OK.Nr"rFr"r"r&�validate_ticket�rJz"ITicketManipulator.validate_ticketcCrE)z�Validate ticket comment when appending or editing.

        Must return a list of messages, one for each problem detected.
        The return value `[]` indicates no problems.

        :since: 1.3.2
        Nr")rGrTr"r"r&�validate_comment�rJz#ITicketManipulator.validate_commentN)r=r>r?r@rbrcrdr"r"r"r&r_�s
r_c@r^)	�IMilestoneChangeListenerzyExtension point interface for components that require notification
    when milestones are created, modified, or deleted.cCrE)z#Called when a milestone is created.Nr"��	milestoner"r"r&�milestone_created�rJz*IMilestoneChangeListener.milestone_createdcCrE)z�Called when a milestone is modified.

        `old_values` is a dictionary containing the previous values of the
        milestone properties that changed. Currently those properties can be
        'name', 'due', 'completed', or 'description'.
        Nr")rgrVr"r"r&�milestone_changed�rJz*IMilestoneChangeListener.milestone_changedcCrE)z#Called when a milestone is deleted.Nr"rfr"r"r&�milestone_deleted�rJz*IMilestoneChangeListener.milestone_deletedN)r=r>r?r@rhrirjr"r"r"r&re�s
rec@seZdZeeeee�ee	�Z
ee�ZdZ
edd�Zeddedddd�Zedd	d
d�Zeddd
d�Zedddd�Zedddd�Zeddd
d�Zeddd
d�Zeddd
d�Zeddd
d�Zeddd
d�Zeddd
d �Zedd!d"d#�Zedd$d
d%�Z edd&d'd(�Z!e"dd)d*d+d,�Z#e$dd-d.d/�Z%e$dd0d.d1�Z&e$dd2d.d3�Z'd4d5�Z(d6d7�Z)d8d9�Z*d:d;�Z+d<d=�Z,d>d?�Z-e.d@dA��Z/gdB�Z0dCdD�Z1e.dEdF��Z2dGdH�Z3dfdJdK�Z4dfdLdM�Z5dNdO�Z6dPdQ�Z7dRdS�Z8dTdU�Z9dVdW�Z:dXdY�Z;dfdZd[�Z<d\d]�Z=d^d_�Z>dgd`da�Z?dhdbdc�Z@ddde�ZAdIS)i�TicketSystemrHz
ticket-customztIn this section, you can define additional fields for tickets. See
        TracTicketsCustomFields for more details.�workflow�ConfigurableTicketWorkflowFzLOrdered list of workflow controllers to use for ticket actions.
            )r1�include_missing�doc�restrict_owner�falsea�Make the owner field of tickets use a drop-down menu.
        Be sure to understand the performance implications before activating
        this option. See
        [TracTickets#Assign-toasDrop-DownList Assign-to as Drop-Down List].

        Please note that e-mail addresses are '''not''' obfuscated in the
        resulting drop-down menu, so this option should not be used if
        e-mail addresses must remain protected.
        �default_version�z*Default version for newly created tickets.�default_type�defectz'Default type for newly created tickets.�default_priority�majorz+Default priority for newly created tickets.�default_milestonez,Default milestone for newly created tickets.�default_componentz,Default component for newly created tickets.�default_severityz+Default severity for newly created tickets.�default_summaryz2Default summary (title) for newly created tickets.�default_descriptionz.Default description for newly created tickets.�default_keywordsz+Default keywords for newly created tickets.�
default_ownerz< default >zzDefault owner for newly created tickets. The component owner
        is used when set to the value `< default >`.
        �
default_ccz+Default cc: list for newly created tickets.�default_resolution�fixedz3Default resolution for resolving (closing) tickets.�allowed_empty_fieldszmilestone, versionz_Comma-separated list of `select` fields that can have
        an empty value. (//since 1.1.2//))ro�max_comment_sizeiz+Maximum allowed comment size in characters.�max_description_sizez/Maximum allowed description size in characters.�max_summary_sizez=Maximum allowed summary size in characters. (//since 1.0.2//)cCs|j�ddd�|jD��dS)Nz*action controllers for ticket workflow: %rcSsg|]}|jj�qSr")r-r=)r$�cr"r"r&�
<listcomp>#�z)TicketSystem.__init__.<locals>.<listcomp>)�log�debug�action_controllersr4r"r"r&r)!s�zTicketSystem.__init__c	Cszi}|jD]#}|�||�pg}|D]\}}||vr#t|||�||<q|||<qqdd�|��D�}dd�t|dd�D�S)z*Returns a sorted list of available actionscSsg|]\}}||f�qSr"r")r$rM�weightr"r"r&r�2sz6TicketSystem.get_available_actions.<locals>.<listcomp>cS�g|]}|d�qS)�r")r$�xr"r"r&r�4r�T)�reverse)r�rI�max�items�sorted)	r*rGrHra�
controller�weighted_actionsr�rM�all_weighted_actionsr"r"r&�get_available_actions's

��z"TicketSystem.get_available_actionscCs,t�}|jD]}|�|��pg�qt|�S)zYReturns a sorted list of all the states all of the action
        controllers know about.)�setr��updaterKr�)r*�valid_statesr�r"r"r&rK6s
zTicketSystem.get_all_statuscCs"dd�|��D�}td�|d<|S)z8Produce a (name,label) mapping from `get_ticket_fields`.cSsi|]	}|d|d�qS)r!�labelr"�r$�fr"r"r&r'@�z8TicketSystem.get_ticket_field_labels.<locals>.<dictcomp>�
Attachment�
attachment)�get_ticket_fieldsr)r*�labelsr"r"r&�get_ticket_field_labels>sz$TicketSystem.get_ticket_field_labelscCs8t�|j�}d}|D]}|�d�st||�||<q
|S)a7Returns list of fields available for tickets.

        Each field is a dict with at least the 'name', 'label' (localized)
        and 'type' keys.
        It may in addition contain the 'custom' key, the 'optional' and the
        'options' keys. When present 'custom' and 'optional' are always `True`.
        r��custom)r6r7r`r0r)r*r`r�r�r"r"r&r�Ds
�zTicketSystem.get_ticket_fieldscCs|`dS)zInvalidate ticket field cache.N)r`r4r"r"r&�reset_ticket_fieldsSsz TicketSystem.reset_ticket_fieldsc	
Csddlm}t�}|�ddtd�d��|�ddtd�d��|�d	dtd
�d��|�ddd
td�d��dtd�|jfdtd�|jfdtd�|jfdtd�|jfdtd�|j	fdtd�|j
fdtd�|jfdtd�|jfg}|D]<\}}}d d!�|�
|j�D�}|s�qr|d"|t|d#|d$�|d%�}|d&vr�d'|d<d(|d)<n	||jvr�d(|d)<|�|�qr|�d*dd+td,�d��|�d-dd+td.�d��|�d/d/d0td1�d��|�d2d/d0td3�d��|jD]}|d4d5d!�|D�vr�|j�d6|d4�q�|�|�q�|S)7z0Return the list of fields available for tickets.r)�model�summary�text�Summary)r!�typer��reporter�Reporter�owner�Owner�description�textarea�wiki�Description)r!r��formatr�r��Type�status�Status�priority�Priorityrg�	Milestone�	component�	Component�version�Version�severity�Severity�
resolution�
ResolutioncSsg|]}|j�qSr"r )r$�valr"r"r&r�wsz'TicketSystem.fields.<locals>.<listcomp>�select�default_rs)r!r�r�r%�options)r�r��radioT�optional�keywords�list�Keywords�cc�Cc�time�relative�Created�
changetime�Modifiedr!cSr�r r"r�r"r"r&r��r�z$Duplicate field name "%s" (ignoring))�trac.ticketr�rr.rr�r�r�r�r�r�r�r�r��env�getattrr��
custom_fieldsr��warning)	r*r�r`�selectsr!r��clsr��fieldr"r"r&r`Wsr������


�
���
�zTicketSystem.fields)�report�order�desc�group�	groupdesc�col�rowr�r��page�verboserT�or�idr�r�r�r�r�r�r�r�cCst�|j�Sr/)r6r7r�r4r"r"r&�get_custom_fields�szTicketSystem.get_custom_fieldsc
sBt�}|j�dd����D�D�]��d�������dd����d�p/��dd��������d	d
�d�����fdd
�}�ddksM�ddkr�j�ddd��d<�ds]qd
�dvsj�d|j	vr{d�d<d
�dvr{�d�
d
�|�nn�ddkr�t�d�r�dnd�d<|�nX�ddkr����dd��d<���dd��d <�dd!vr�|�n4�dd"kr݈��dd��d<���dd��d <���d#��d$<n�dd%kr���dd&��d<�d|jvr�|j
�d'�d�qt�d(�d��s|j
�d)�d�q|���q|jd*d+�d,�|S)-z>Return the list of custom ticket fields available for tickets.cSsg|]
\}}d|vr|�qS)�.r")r$�optionr%r"r"r&r��s�z.TicketSystem.custom_fields.<locals>.<listcomp>Tz.orderrz.labelr� z.valuers)r!r�r�r�r�r%cs���dd��d<dS)Nz.ticketlink_query�ticketlink_query)r0r"��configr�r!r"r&�_get_ticketlink_query�s
�z9TicketSystem.custom_fields.<locals>._get_ticketlink_queryr�r�r�z.options�|)�sepr�r!r��checkboxr%�1�0r�z.format�plainr�z	.max_size�max_size)�	referencer�r�z.rows�heightr�rz-Field name "%s" is a reserved name (ignoring)z^[a-zA-Z][a-zA-Z0-9_]+$z.Invalid name for custom field: "%s" (ignoring)cSs|d|dfS)Nr�r!r")r�r"r"r&�<lambda>�sz,TicketSystem.custom_fields.<locals>.<lambda>)�key)r�ticket_custom_sectionr�r0�getint�replace�strip�
capitalize�getlistr��remover�reserved_field_namesr�r��re�matchr.�sort)r*r`r�r"r�r&r��sd�
���zTicketSystem.custom_fieldscCs
ddd�S)z�Return a mapping from field name synonyms to field names.
        The synonyms are supposed to be more intuitive for custom queries.r�r�)�created�modifiedr"r4r"r"r&�get_field_synonyms�s
zTicketSystem.get_field_synonymsNcCs,|jrd|d<|�|�|d<d|d<dSdS)z|Restrict given owner field to be a list of users having
        the TICKET_MODIFY permission (for the given ticket)
        r�r�r�Tr�N)rp�get_allowed_owners)r*r�rHr"r"r&�eventually_restrict_owner�s
�z&TicketSystem.eventually_restrict_ownercCsR|jr'g}t|j��d�D]}|rdt|j||j�vr |�|�q
|��|SdS)a_Returns a list of permitted ticket owners (those possessing the
        TICKET_MODIFY permission). Returns `None` if the option `[ticket]`
        `restrict_owner` is `False`.

        If `ticket` is not `None`, fine-grained permission checks are used
        to determine the allowed owners for the specified resource.

        :since: 1.0.3
        �
TICKET_MODIFYN)rpr
r��get_users_with_permissionr�resourcer.r)r*rH�allowed_owners�userr"r"r&r�s
�
�
��zTicketSystem.get_allowed_ownerscCsdSr/r")r*rGrHr`rar"r"r&rbszTicketSystem.prepare_ticketccs�|jD]<}d|vrq|d}|dkrq||vr@||jvr@||}|r3||dvr2|td|d�fVq|�dd�s@|td�fVqt|d	pGd
�|jkrVd	td|jd�fV|d
sbd
td�fVnt|d
phd
�|jkrwd
td|jd�fV|jD]0}|j�|�}|�dd�}d|kr�t||p�d
�kr�nqz|�d�}|p�|td|d�fVqz|j	D]Y}||}||jv�r||jv�rt
|t��s|j�|�}|�d�}	z|r�t|t
||	d�nd||<Wq�t�y}
z|||<|�d�}|p�|t|
�fVWYd}
~
q�d}
~
wwq�dS)Nr�r!r�z "%(value)s" is not a valid value)r%r�Fzfield cannot be emptyr�rs�0Must be less than or equal to %(num)s characters��numr�zTickets must contain a summary.r�rr�r�)�hint)r`�_oldrr0�lenr�r�r�r2�time_fields�
isinstancerrr�	TracErrorr)r*rGrHr�r!r%�field_attrsr�r�r��er"r"r&rc	sx�

���
�
�
$


��
�

��
�
����zTicketSystem.validate_ticketccs,�t|pd�|jkrtd|jd�VdSdS)Nrsr
r)rr�r)r*rGrTr"r"r&rdBs���zTicketSystem.validate_commentcCs&ddddddddddgfd	gd
�fg	S)N�
TICKET_APPEND�
TICKET_CREATE�TICKET_CHGPROP�TICKET_VIEW�TICKET_EDIT_CC�TICKET_EDIT_DESCRIPTION�TICKET_EDIT_COMMENTr�TICKET_ADMIN)rrrrrrr"r4r"r"r&�get_permission_actionsJs

�z#TicketSystem.get_permission_actionscCs$d|jfd|jfd|jfd|jfgS)N�bug�issuerHrT)�_format_link�_format_comment_linkr4r"r"r&�get_link_resolversVs
�zTicketSystem.get_link_resolversc#s$�dtjtjf�fdd�fVdS)Nz!?(?<!&)#(?P<it_ticket>%s)%scs��|d|dd�||�S)NrHr�)r#)r��y�zr4r"r&r�cr�z.TicketSystem.get_wiki_syntax.<locals>.<lambda>)r�INTERTRAC_SCHEMEr�RE_STRr4r"r4r&�get_wiki_syntax\s���

�zTicketSystem.get_wiki_syntaxcCsd|�||||�}|r|Sz�|�|�\}}}	t|�}
t|
�dkrr|
j}|�|j|�}ddlm}
|
�	|�rqd|�
|�vrq|j�dt
|�f�D]+\}}}}|�||||�}d||f}|j�|�||	}tj|||d|d�WSn.t
|
�}|r�d	|dd�}|�d
d�}|�d
d�}tj|td
|d�|jj|d�|d�WSWn	ty�Ynwtj|dd�S)Nr�r��Ticketrz�
                            SELECT type, summary, status, resolution
                            FROM ticket WHERE id=%s
                            z#%s: %sz	%s ticket)�title�href�class_�&�,u,​z, zTickets %(ranges)s)�ranges)r�)r-r.�missing ticket)r/)�shorthand_intertrac_helper�
split_linkrr�ar
�realm�trac.ticket.modelr,�id_is_valid�permr��db_query�str�format_summaryr.rHrr�r�query�
ValueError)r*�	formatter�ns�targetr��	fullmatch�	intertrac�link�params�fragment�rrrHr,r�r�r�r�r�r-r.r2�
label_wrap�ranges_wrapr"r"r&r#esR
�
���
��
���zTicketSystem._format_linkcCs�d}d|vr9|�d�}t|�dkr8|\}}}	|dkr'|r'|d��s'|\}}	}t|	d�}	|dvr2d}|�||	�}n|j}|}|r�|jr�|j|jkr�|r�|��sS|dkr�d}
}}|�|�r�ddlm	}
|
|j
|j�}|dkr{|�|�s{td�}d	}ndd
|�
|�vr�|j�|j�d|}
|j|jjkr�|�|d|d
|d|d�}|dkr�td|j|d�}n	td||j|d�}|d
d}n|dkr�td�ntd|d�}d}n
td�}d}ntd�}d	}tj|||
|d�S|S)N�:�r�r)r!r"rHr+zticket comment does not existr3rz#comment:%sr�r�r�r�z$Description for #%(id)s: %(summary)s)r�r�z)Comment %(cnum)s for #%(id)s: %(summary)s)�cnumr�r�z ticketr�zComment %(cnum)s)rMzno permission to view ticketzforbidden ticketzticket does not exist)r/r.r-)�splitr�isdigitrr
r�r7�resource_existsr8r,r��
get_changerr:r.rHr=rr6)r*r@rArBr�r
�eltsrMr7r�r.r-r/r,rHr�r"r"r&r$�st



���
�
�����z!TicketSystem._format_comment_linkccs�|jVdSr/)r7r4r"r"r&�get_resource_realms�s�z TicketSystem.get_resource_realmscs^|dkr	d|jS|dkr(ddlm}||j|j���fdd�dD�}|j|�Std	|jd
�S)N�compactz#%sr�rr+csg|]}�|�qSr"r"r�rRr"r&r��r�z9TicketSystem.get_resource_description.<locals>.<listcomp>)r�r�r�r�zTicket #%(shortname)s)�	shortname)r�r8r,r�r=r)r*r
r��context�kwargsr,r+r"rRr&�get_resource_description�s

z%TicketSystem.get_resource_descriptioncCsDt|�}|r|d|}|r |dkr|r|d|7}d||fS|S)Nz: �closedz%s (%s))r)r*r�r�r�r�r"r"r&r=�szTicketSystem.format_summaryc	Cslzt|j�}WnttfyYdSw|j�d|f�r4|jdur#dS|j�d|f�}|dd|jkSdS)a�
        >>> from trac.test import EnvironmentStub
        >>> from trac.resource import Resource, resource_exists
        >>> env = EnvironmentStub()

        >>> resource_exists(env, Resource('ticket', 123456))
        False

        >>> from trac.ticket.model import Ticket
        >>> t = Ticket(env)
        >>> int(t.insert())
        1
        >>> resource_exists(env, t.resource)
        True
        Fz!SELECT id FROM ticket WHERE id=%sNTz`
                SELECT count(DISTINCT time) FROM ticket_change WHERE ticket=%s
                r)�intr��	TypeErrorr?r�r;r�)r*r
�id_�revcountr"r"r&rP�s�
�zTicketSystem.resource_existsr/)NN)NNN)Br=r>r?�
implementsrrrr_�ExtensionPointrQ�change_listenersre�milestone_change_listenersr7rr�r	rDr�rrprrrrtrvrxryrzr{r|r}r~rr�rr�rr�r�r�r)r�rKr�r�r�rr`r�r�r�rrrrbrcrdr r%r*r#r$rSrXr=rPr"r"r"r&rk�s���������������������
C
;

	9
	(9

rkccsf�t�}|durt|j�}|j}|��|_zdVW|dur!||_t|�dS|dur.||_t|�wr/)rrkr�r`r�r)rH�t�ts�translated_fieldsr"r"r&�translation_deactivated�s�

�
rer/)4�
contextlibr6rr�
trac.cacher�trac.configrrrrrr	�	trac.core�	trac.permrrr
�
trac.resourcer�	trac.utilrrr�trac.util.datefmtrr�trac.util.htmlr�trac.util.textrr�trac.util.translationrrrrr�	trac.wikirrr�r�	InterfacerDrQr_rer�rk�contextmanagerrer"r"r"r&�<module>s6 K4

https://t.me/RX1948 - 2025