Project

General

Profile

Revision 00456667

ID00456667714dbe3514d7ccba9bfbcbd92ae126e8
Parent e4b8d982
Child 62c4c6f5

Added by Francois POIROTTE over 14 years ago

Nettoyage du code de VigiGraph.

git-svn-id: https://vigilo-dev.si.c-s.fr/svn@2654 b22e2e97-25c9-44ff-b637-2e5ceca36478

View differences:

vigigraph/controllers/rpc.py
42 42
    """
43 43

  
44 44
    presets = [
45
        {"caption" : _("Last %s hours") % '12', "duration" : 43200},
46
        {"caption" : _("Last %s hours") % '24', "duration" : 86400},
47
        {"caption" : _("Last %s days") % '2',  "duration" : 192800},
48
        {"caption" : _("Last %s days") % '7',  "duration" : 604800},
49
        {"caption" : _("Last %s days") % '14', "duration" : 1209600},
50
        {"caption" : _("Last %s months") % '3', "duration" : 86400*31*3},
51
        {"caption" : _("Last %s months") % '6', "duration" : 86400*183},
45
        {"caption" : _("Last %d hours") %  12, "duration" : 43200},
46
        {"caption" : _("Last %d hours") %  24, "duration" : 86400},
47
        {"caption" : _("Last %d days") %    2, "duration" : 192800},
48
        {"caption" : _("Last %d days") %    7, "duration" : 604800},
49
        {"caption" : _("Last %d days") %   14, "duration" : 1209600},
50
        {"caption" : _("Last %d months") %  3, "duration" : 86400*31*3},
51
        {"caption" : _("Last %d months") %  6, "duration" : 86400*183},
52 52
        {"caption" : _("Last year"), "duration" : 86400*365},
53 53
    ]
54 54

  
55
    def _get_host(self, hostname):
56
        """
57
        Return Host object from hostname, None if not available
58
        """
59
        return DBSession.query(Host) \
60
                .filter(Host.name == hostname) \
61
                .first()
62

  
63 55
    @expose('json')
64 56
    def maingroups(self, nocache=None):
65 57
        """

Also available in: Unified diff