vigiboard / vigiboard / controllers / plugins / test.py @ cf3c2494
History | View | Annotate | Download (1.92 KB)
1 | 15b98053 | Francois POIROTTE | # -*- coding: utf-8 -*-
|
---|---|---|---|
2 | a77de887 | Francois POIROTTE | # vim:set expandtab tabstop=4 shiftwidth=4:
|
3 | ################################################################################
|
||
4 | #
|
||
5 | 3b537383 | Francois POIROTTE | # Copyright (C) 2007-2011 CS-SI
|
6 | a77de887 | Francois POIROTTE | #
|
7 | # This program is free software; you can redistribute it and/or modify
|
||
8 | # it under the terms of the GNU General Public License version 2 as
|
||
9 | # published by the Free Software Foundation.
|
||
10 | #
|
||
11 | # This program is distributed in the hope that it will be useful,
|
||
12 | # but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||
13 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||
14 | # GNU General Public License for more details.
|
||
15 | #
|
||
16 | # You should have received a copy of the GNU General Public License
|
||
17 | # along with this program; if not, write to the Free Software
|
||
18 | # Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
||
19 | ################################################################################
|
||
20 | |||
21 | 15b98053 | Francois POIROTTE | """
|
22 | Ce fichier contient un exemple de plugin pour l'interface
|
||
23 | de VigiBoard. Il s'accompagne d'un template contenu dans
|
||
24 | les thèmes, dans le répertoire suivant :
|
||
25 | 94f31908 | Francois POIROTTE | vigilo/themes/templates/vigiboard/plugins/test.html
|
26 | 15b98053 | Francois POIROTTE | """
|
27 | 94f31908 | Francois POIROTTE | from vigiboard.controllers.plugins import VigiboardRequestPlugin |
28 | 15b98053 | Francois POIROTTE | |
29 | class PluginTest(VigiboardRequestPlugin): |
||
30 | """
|
||
31 | Un plugin de démonstration qui se contente d'afficher
|
||
32 | "Hello world" pour chaque événement du tableau.
|
||
33 | """
|
||
34 | |||
35 | cf3c2494 | Vincent QUEMENER | def get_bulk_data(self, events_ids): |
36 | 15b98053 | Francois POIROTTE | """
|
37 | cf3c2494 | Vincent QUEMENER | Cette méthode est appelée par le L{RootController} de VigiBoard.
|
38 | Elle renvoie les données à afficher pour chaque évènement.
|
||
39 | 15b98053 | Francois POIROTTE |
|
40 | cf3c2494 | Vincent QUEMENER | @param events_ids: Liste des identifiants des événements corrélés
|
41 | à afficher.
|
||
42 | @type events_ids: C{int}
|
||
43 | @return: Un dictionnaire associant à chaque identifiant d'évènement
|
||
44 | un texte statique.
|
||
45 | @rtype: C{dict}
|
||
46 | 15b98053 | Francois POIROTTE | """
|
47 | cf3c2494 | Vincent QUEMENER | plugin_data = {} |
48 | for event in events_ids: |
||
49 | plugin_data[event] = 'Hello world'
|
||
50 | |||
51 | return plugin_data
|