trac.versioncontrol.web_ui.browser
¶
-
class
trac.versioncontrol.web_ui.browser.
DefaultPropertyRenderer
¶ Bases:
trac.core.Component
Default version control property renderer.
-
class
trac.versioncontrol.web_ui.browser.
IPropertyRenderer
¶ Bases:
trac.core.Interface
Render node properties in TracBrowser and TracChangeset views.
-
match_property
(name, mode)¶ 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).
-
render_property
(name, mode, context, props)¶ Render the given property.
name
is the property name as given tomatch()
,mode
is the same as formatch_property
,context
is the context for the node being render (useful when the rendering depends on the node kind) andprops
is 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
unicode
value: the property will be displayed as text - a
RenderedProperty
instance: the property will only be displayed using the instance’scontent
attribute, and the other attributes will also be used in some display contexts (likerevprop
) Markup
orFragment
: the property will be displayed normally, using that content as a block-level markup
-
-
class
trac.versioncontrol.web_ui.browser.
WikiPropertyRenderer
¶ Bases:
trac.core.Component
Wiki text property renderer.
-
oneliner_properties
¶ Comma-separated list of version control properties to render as oneliner wiki content in the repository browser.
-
wiki_properties
¶ Comma-separated list of version control properties to render as wiki content in the repository browser.
-
-
trac.versioncontrol.web_ui.browser.
datetime_now
()¶ [tz] -> new datetime with tz’s local day and time.