Package Products :: Package ZenModel :: Module StatusColor |
[hide private]
[frames] | no frames]

# Source Code for Module Products.ZenModel.StatusColor

     1  ##############################################################################
     2  #
     3  # Copyright (C) Zenoss, Inc. 2007, all rights reserved.
     4  #
     5  # This content is made available according to terms specified in
     6  # License.zenoss under the directory where your Zenoss product is installed.
     7  #
     8  ##############################################################################
     9
    10
    11  __doc__="""Status
    12
    13  StatusColor class is a base for things which have status
    14  that needs to be represented in html with color.
    15
    16  $Id: StatusColor.py,v 1.8 2004/04/04 01:51:19 edahl Exp $"""
    17
    18  __version__ = "$Revision: 1.8 $"[11:-2]
    19
    20 -class StatusColor:
    21      """Status object"""
    22
    23 -    def devStatusColor(self, status):
    24          retval="#00ff00"
    25          if status == -1:
    26              retval = "#d02090"
    27          elif status == -2:
    28              retval = "#ff9900"
    29          elif status > 0:
    30              retval = "#ff0000"
    31          return retval
    32
    33 -    def pingColor(self):
    34          return self.statusColor(self.pingStatus)
    35
    36 -    def snmpColor(self):
    37          return self.statusColor(self.snmpStatus)
    38