File: //usr/lib/python3/dist-packages/trac/versioncontrol/web_ui/__pycache__/browser.cpython-310.pyc
o
�k�`� � @ s� d dl Z d dlmZmZ d dlmZ d dlmZmZmZ d dl T d dl
mZmZm
Z
d dlmZmZ d dlmZmZ d d lmZmZ d d
lmZmZmZmZ d dlmZmZmZ d dl m!Z!m"Z" d d
l#m$Z$m%Z% d dl&m'Z'm(Z( d dl)T d dl*m+Z+m,Z, d dl-m.Z.m/Z/m0Z0m1Z1m2Z2m3Z3m4Z4m5Z5 d dl6m7Z7m8Z8m9Z9 d dl:m;Z;m<Z< dZ=G dd� de>�Z?G dd� de@�ZAG dd� deB�ZCG dd� deB�ZDG dd� de@�ZEG dd� deB�ZFG d d!� d!e@�ZGdS )"� N)�datetime� timedelta��fnmatchcase)�
BoolOption�
ListOption�Option)�*)�IHTMLPreviewAnnotator�Mimeview� is_binary)�IPermissionRequestor�PermissionError)�Resource�ResourceNotFound)�as_bool�embedded_numbers)�datetime_now� http_date�to_datetime�utc)�Markup�escape�tag)�exception_to_unicode�shorten_line)�_� cleandoc_)�NoSuchChangeset�RepositoryManager)�IRequestHandler�RequestDone)�Chrome�INavigationContributor�add_ctxtnav�add_link�
add_script�add_stylesheet�prevnext_nav�web_context)�IWikiMacroProvider�IWikiSyntaxProvider�
parse_args)�format_to_html�format_to_onelineri c @ s e Zd ZdZdd� Zdd� ZdS )�IPropertyRendererz>Render node properties in TracBrowser and TracChangeset views.c C � dS )a Indicate whether this renderer can treat the given property
`mode` is the current rendering context, which can be:
- 'browser' rendered in the browser view
- 'changeset' rendered in the changeset view as a node property
- 'revprop' rendered in the changeset view as a revision property
Other identifiers might be used by plugins, so it's advised to simply
ignore unknown modes.
Returns a quality number, ranging from 0 (unsupported) to 9
(''perfect'' match).
N� )�name�moder1 r1 �D/usr/lib/python3/dist-packages/trac/versioncontrol/web_ui/browser.py�match_property0 � z IPropertyRenderer.match_propertyc C r0 )a� Render the given property.
`name` is the property name as given to `match()`,
`mode` is the same as for `match_property`,
`context` is the context for the node being render
(useful when the rendering depends on the node kind) and
`props` is the collection of the corresponding properties
(i.e. the `node.get_properties()`).
The rendered result can be one of the following:
- `None`: the property will be skipped
- a `str` value: the property will be displayed as text
- a `RenderedProperty` instance: the property will only be displayed
using the instance's `content` attribute, and the other attributes
will also be used in some display contexts (like `revprop`)
- `Markup` or `Fragment`: the property will be displayed
normally, using that content as a block-level markup
Nr1 )r2 r3 �context�propsr1 r1 r4 �render_property? r6 z!IPropertyRenderer.render_propertyN)�__name__�
__module__�__qualname__�__doc__r5 r9 r1 r1 r1 r4 r/ - s r/ c @ s e Zd Z ddd�ZdS )�RenderedPropertyNc C s || _ || _|| _|| _d S �N)r2 �name_attributes�content�content_attributes)�selfr2 r@ rA rB r1 r1 r4 �__init__U s
zRenderedProperty.__init__)NNNN)r: r; r<