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

Source Code for Module Products.ZenModel.CommentGraphPoint

 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__="""CommentGraphPoint 
12   
13  Handles GraphPoints that define an rrd COMMENT 
14  """ 
15   
16  from GraphPoint import GraphPoint 
17  from Globals import InitializeClass 
18   
19 -def manage_addCommentGraphPoint(context, id, REQUEST = None):
20 ''' This is here so than zope will let us copy/paste/rename 21 graphpoints. 22 ''' 23 gp = CommentGraphPoint(id) 24 context._setObject(gp.id, gp) 25 if REQUEST: 26 return context.callZenScreen(REQUEST)
27 28
29 -class CommentGraphPoint(GraphPoint):
30 31 meta_type = 'CommentGraphPoint' 32 33 text = '' 34 35 _properties = GraphPoint._properties + ( 36 {'id':'text', 'type':'string', 'mode':'w'}, 37 ) 38
39 - def getDescription(self):
40 return self.text
41 42
43 - def getType(self):
44 return 'COMMENT'
45 46
47 - def getGraphCmds(self, cmds, context, rrdDir, addSummary, idx, 48 multiid=-1, prefix=''):
49 ''' Build the graphing commands for this graphpoint 50 ''' 51 from Products.ZenUtils.Utils import unused 52 unused(cmds, context, rrdDir, addSummary, idx, multiid, prefix) 53 return cmds + ['COMMENT:%s' % self.text.replace(':', '\:')]
54 55 56 InitializeClass(CommentGraphPoint) 57