trac.versioncontrol.web_ui.browser¶
-
class
trac.versioncontrol.web_ui.browser.IPropertyRenderer¶ Bases:
trac.core.InterfaceRender node properties in TracBrowser and TracChangeset views.
-
match_property(mode)¶ Indicate whether this renderer can treat the given property
modeis 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).
-
render_property(mode, context, props)¶ Render the given property.
nameis the property name as given tomatch(),modeis the same as formatch_property,contextis the context for the node being render (useful when the rendering depends on the node kind) andpropsis the collection of the corresponding properties (i.e. thenode.get_properties()).- The rendered result can be one of the following:
None: the property will be skipped- an
unicodevalue: the property will be displayed as text - a
RenderedPropertyinstance: the property will only be displayed using the instance’scontentattribute, and the other attributes will also be used in some display contexts (likerevprop) MarkuporFragment: the property will be displayed normally, using that content as a block-level markup
-
-
class
trac.versioncontrol.web_ui.browser.DefaultPropertyRenderer¶ Bases:
trac.core.ComponentDefault version control property renderer.
-
class
trac.versioncontrol.web_ui.browser.WikiPropertyRenderer¶ Bases:
trac.core.ComponentWiki text property renderer.
-
wiki_properties¶ Comma-separated list of version control properties to render as wiki content in the repository browser.
-
oneliner_properties¶ Comma-separated list of version control properties to render as oneliner wiki content in the repository browser.
-
-
class
trac.versioncontrol.web_ui.browser.BrowserModule¶ Bases:
trac.core.Component-
property_renderers¶ List of components that implement
IPropertyRenderer
-
downloadable_paths¶ List of repository paths that can be downloaded.
Leave this option empty if you want to disable all downloads, otherwise set it to a comma-separated list of authorized paths (those paths are glob patterns, i.e. “*” can be used as a wild card). In a multi-repository environment, the path must be qualified with the repository name if the path does not point to the default repository (e.g. /reponame/trunk). Note that a simple prefix matching is performed on the paths, so aliases won’t get automatically resolved.
-
color_scale¶ Enable colorization of the ‘’age’’ column.
This uses the same color scale as the source code annotation: blue is older, red is newer.
-
newest_color¶ (r,g,b) color triple to use for the color corresponding to the newest color, for the color scale used in ‘’blame’’ or the browser ‘’age’’ column if
color_scaleis enabled.
-
oldest_color¶ (r,g,b) color triple to use for the color corresponding to the oldest color, for the color scale used in ‘’blame’’ or the browser ‘’age’’ column if
color_scaleis enabled.
-
intermediate_point¶ If set to a value between 0 and 1 (exclusive), this will be the point chosen to set the
intermediate_colorfor interpolating the color value.
-
intermediate_color¶ (r,g,b) color triple to use for the color corresponding to the intermediate color, if two linear interpolations are used for the color scale (see
intermediate_point). If not set, the intermediate color betweenoldest_colorandnewest_colorwill be used.
-
render_unsafe_content¶ Whether raw files should be rendered in the browser, or only made downloadable.
Pretty much any file may be interpreted as HTML by the browser, which allows a malicious user to create a file containing cross-site scripting attacks.
For open repositories where anyone can check-in a file, it is recommended to leave this option disabled.
Comma-separated list of version control properties to hide from the repository browser.
-
get_custom_colorizer()¶ Returns a converter for values from [0.0, 1.0] to a RGB triple.
-
render_properties(mode, context, props)¶ Prepare rendering of a collection of properties.
-
render_property(name, mode, context, props)¶ Renders a node property to HTML.
-
get_link_resolvers()¶ TracBrowser link resolvers.
source:andbrowser:- simple paths (/dir/file)
- paths at a given revision (/dir/file@234)
- paths with line number marks (/dir/file@234:10,20-30)
- paths with line number anchor (/dir/file@234#L100)
Marks and anchor can be combined. The revision must be present when specifying line numbers. In the few cases where it would be redundant (e.g. for tags), the revision number itself can be omitted: /tags/v10/file@100-110#L99
-
get_annotation_data(context)¶ Cache the annotation data corresponding to each revision.
-
-
trac.versioncontrol.web_ui.browser.datetime_now()¶ [tz] -> new datetime with tz’s local day and time.