vigiboard / vigiboard / controllers / plugins / test.py @ 8c198622
History | View | Annotate | Download (1.21 KB)
1 |
# -*- coding: utf-8 -*-
|
---|---|
2 |
# vim:set expandtab tabstop=4 shiftwidth=4:
|
3 |
# Copyright (C) 2007-2019 CS-SI
|
4 |
# License: GNU GPL v2 <http://www.gnu.org/licenses/gpl-2.0.html>
|
5 |
|
6 |
"""
|
7 |
Ce fichier contient un exemple de plugin pour l'interface
|
8 |
de VigiBoard. Il s'accompagne d'un template contenu dans
|
9 |
les thèmes, dans le répertoire suivant :
|
10 |
vigilo/themes/templates/vigiboard/plugins/test.html
|
11 |
"""
|
12 |
from vigiboard.controllers.plugins import VigiboardRequestPlugin |
13 |
|
14 |
class PluginTest(VigiboardRequestPlugin): |
15 |
"""
|
16 |
Un plugin de démonstration qui se contente d'afficher
|
17 |
"Hello world" pour chaque événement du tableau.
|
18 |
"""
|
19 |
|
20 |
def get_bulk_data(self, events_ids): |
21 |
"""
|
22 |
Cette méthode est appelée par le L{RootController} de VigiBoard.
|
23 |
Elle renvoie les données à afficher pour chaque évènement.
|
24 |
|
25 |
@param events_ids: Liste des identifiants des événements corrélés
|
26 |
à afficher.
|
27 |
@type events_ids: C{int}
|
28 |
@return: Un dictionnaire associant à chaque identifiant d'évènement
|
29 |
un texte statique.
|
30 |
@rtype: C{dict}
|
31 |
"""
|
32 |
plugin_data = {} |
33 |
for event in events_ids: |
34 |
plugin_data[event] = 'Hello world'
|
35 |
|
36 |
return plugin_data
|
37 |
|