Trees | Indices | Help |
|
---|
|
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 or (at your 8 # option) any later version as published by the Free Software Foundation. 9 # 10 # For complete information please visit: http://www.zenoss.com/oss/ 11 # 12 ########################################################################### 13 import Globals 14 import zope.interface 15 16 from collections import defaultdict 17 from Products.ZenUtils.Utils import convToUnits 18 19 UNAVAILABLE = 'N/A' 2022 if partial is None or total is None: 23 return None 24 if not total: 25 return None 26 return partial * 100 / total27 28 33 3436 zope.interface.implements( zope.interface.Interface ) 37 __allow_access_to_unprotected_subobjects__ = 1 3876 77 8640 self.values = kw.copy()4143 return str(self.values)44 4547 return repr(self.values)48 49 52 5557 return percent(partial, total)5860 return percentString(n, decimals)61 6668 if value is None: 69 return UNAVAILABLE 70 return convToUnits(value * scale, 1000, unitstr=unitstr)71
Trees | Indices | Help |
|
---|
Generated by Epydoc 3.0.1.1812 on Tue Oct 11 12:52:02 2011 | http://epydoc.sourceforge.net |