Trees Indices Help
Trac
Package trac :: Package timeline :: Module api

Source Code for Module trac.timeline.api

 1 # -*- coding: utf-8 -*- 
 2 # 
 3 # Copyright (C) 2003-2009 Edgewall Software 
 4 # Copyright (C) 2003-2005 Jonas Borgström <jonas@edgewall.com> 
 5 # Copyright (C) 2004-2005 Christopher Lenz <cmlenz@gmx.de> 
 6 # Copyright (C) 2005-2006 Christian Boos <cboos@edgewall.org> 
 7 # All rights reserved. 
 8 # 
 9 # This software is licensed as described in the file COPYING, which 
10 # you should have received as part of this distribution. The terms 
11 # are also available at http://trac.edgewall.org/wiki/TracLicense. 
12 # 
13 # This software consists of voluntary contributions made by many 
14 # individuals. For the exact contribution history, see the revision 
15 # history and logs, available at http://trac.edgewall.org/log/. 
16 # 
17 # Author: Jonas Borgström <jonas@edgewall.com> 
18 # Christopher Lenz <cmlenz@gmx.de> 
19 
20 from trac .core  import * 
21 
22 
23 - class ITimelineEventProvider (Interface):
24 """Extension point interface for adding sources for timed events to the 25 timeline. 26 """ 27
28 - def get_timeline_filters (req):
29 """Return a list of filters that this event provider supports. 30 31 Each filter must be a (name, label) tuple, where `name` is the internal 32 name, and `label` is a human-readable name for display. 33 34 Optionally, the tuple can contain a third element, `checked`. 35 If `checked` is omitted or True, the filter is active by default, 36 otherwise it will be inactive. 37 """
38
39 - def get_timeline_events (req, start, stop, filters):
40 """Return a list of events in the time range given by the `start` and 41 `stop` parameters. 42 43 The `filters` parameters is a list of the enabled filters, each item 44 being the name of the tuples returned by `get_timeline_filters`. 45 46 Since 0.11, the events are `(kind, date, author, data)` tuples, 47 where `kind` is a string used for categorizing the event, `date` 48 is a `datetime` object, `author` is a string and `data` is some 49 private data that the component will reuse when rendering the event. 50 51 When the event has been created indirectly by another module, 52 like this happens when calling `AttachmentModule.get_timeline_events()` 53 the tuple can also specify explicitly the provider by returning tuples 54 of the following form: `(kind, date, author, data, provider)`. 55 56 Before version 0.11, the events returned by this function used to 57 be tuples of the form `(kind, href, title, date, author, markup)`. 58 This is still supported but less flexible, as `href`, `title` and 59 `markup` are not context dependent. 60 """
61
62 - def render_timeline_event (context, field, event):
63 """Display the title of the event in the given context. 64 65 :param context: the rendering `Context` object that can be used for 66 rendering 67 :param field: what specific part information from the event should 68 be rendered: can be the 'title', the 'description' or 69 the 'url' 70 :param event: the event tuple, as returned by `get_timeline_events` 71 """
72

Trees Indices Help
Trac
Generated by Epydoc 3.0.1 on Mon Feb 13 23:37:27 2023 http://epydoc.sourceforge.net

AltStyle によって変換されたページ (->オリジナル) /