trac.timeline.api¶
-
class
trac.timeline.api.ITimelineEventProvider¶ Bases:
trac.core.InterfaceExtension point interface for adding sources for timed events to the timeline.
-
get_timeline_events(req, start, stop, filters)¶ Return a list of events in the time range given by the
startandstopparameters.The
filtersparameters is a list of the enabled filters, each item being the name of the tuples returned byget_timeline_filters.The events are
(kind, date, author, data)tuples, wherekindis a string used for categorizing the event,dateis adatetimeobject,authoris a string anddatais some private data that the component will reuse when rendering the event.When the event has been created indirectly by another module, like this happens when calling
AttachmentModule.get_timeline_events()the tuple can also specify explicitly the provider by returning tuples of the following form:(kind, date, author, data, provider).
-
get_timeline_filters(req)¶ Return a list of filters that this event provider supports.
Each filter must be a (name, label) tuple, where
nameis the internal name, andlabelis a human-readable name for display.Optionally, the tuple can contain a third element,
checked. Ifcheckedis omitted or True, the filter is active by default, otherwise it will be inactive.
-
render_timeline_event(context, field, event)¶ Display the title of the event in the given context.
Parameters: - context – the
RenderingContextobject that can be used for rendering - field – what specific part information from the event should be rendered: can be the ‘title’, the ‘description’ or the ‘url’
- event – the event tuple, as returned by
get_timeline_events
- context – the
-