Package ZenModel :: Module CommentGraphPoint
[hide private]
[frames] | no frames]

Source Code for Module ZenModel.CommentGraphPoint

 1  ########################################################################### 
 2  # 
 3  # This program is part of Zenoss Core, an open source monitoring platform. 
 4  # Copyright (C) 2007, Zenoss Inc. 
 5  # 
 6  # This program is free software; you can redistribute it and/or modify it 
 7  # under the terms of the GNU General Public License version 2 as published by 
 8  # the Free Software Foundation. 
 9  # 
10  # For complete information please visit: http://www.zenoss.com/oss/ 
11  # 
12  ########################################################################### 
13   
14  __doc__="""CommentGraphPoint 
15   
16  Handles GraphPoints that define an rrd COMMENT 
17  """ 
18   
19  from GraphPoint import GraphPoint 
20  from Globals import InitializeClass 
21   
22 -def manage_addCommentGraphPoint(context, id, REQUEST = None):
23 ''' This is here so than zope will let us copy/paste/rename 24 graphpoints. 25 ''' 26 gp = CommentGraphPoint(id) 27 context._setObject(gp.id, gp) 28 if REQUEST: 29 return context.callZenScreen(REQUEST)
30 31
32 -class CommentGraphPoint(GraphPoint):
33 34 meta_type = 'CommentGraphPoint' 35 36 text = '' 37 38 _properties = GraphPoint._properties + ( 39 {'id':'text', 'type':'string', 'mode':'w'}, 40 ) 41
42 - def getDescription(self):
43 return self.text
44 45
46 - def getType(self):
47 return 'COMMENT'
48 49
50 - def getGraphCmds(self, cmds, context, rrdDir, addSummary, idx, 51 multiid=-1, prefix=''):
52 ''' Build the graphing commands for this graphpoint 53 ''' 54 from Products.ZenUtils.Utils import unused 55 unused(cmds, context, rrdDir, addSummary, idx, multiid, prefix) 56 return cmds + ['COMMENT:%s' % self.text.replace(':', '\:')]
57 58 59 InitializeClass(CommentGraphPoint) 60