コード例 #1
0
 def getProperty(self, id, d=None):
     """Get property value and apply transformer.  Overrides method in
     Zope's PropertyManager class.  Acquire values from aquisiton parents
     if needed.
     """
     ob = self._findParentWithProperty(id)
     return d if (ob is None) else PropertyManager.getProperty(ob, id, d)
コード例 #2
0
 def getProperty(self, id, d=None):
     """Get property value and apply transformer.  Overrides method in
     Zope's PropertyManager class.  Acquire values from aquisiton parents
     if needed.
     """
     ob = self._findParentWithProperty(id)
     return d if (ob is None) else PropertyManager.getProperty(ob, id, d)
コード例 #3
0
ファイル: utils.py プロジェクト: zenoss/zenoss-prodbin
def getZProperties(context):
    """
    Given a context, this function will return all of the ZProperties that
    are defined for this context (ignoring acquisition)
    @returns Dictionary of the form { 'zPropertyName' : 'zPropertyValue',}
    """
    properties = {}
    # make sure we actually have properties
    if not isinstance(context, ZenPropertyManager):
        return properties

    for zprop in filter(iszprop, context.propertyIds()):
        properties[zprop] = PropertyManager.getProperty(context, zprop)
    return properties
コード例 #4
0
ファイル: utils.py プロジェクト: bbc/zenoss-prodbin
def getZProperties(context):
    """
    Given a context, this function will return all of the ZProperties that
    are defined for this context (ignoring acquisition)
    @returns Dictionary of the form { 'zPropertyName' : 'zPropertyValue',}
    """
    properties = {}
    # make sure we actually have properties
    if not isinstance(context, ZenPropertyManager):
        return properties

    for zprop in filter(iszprop, context.propertyIds()):
        properties[zprop] = PropertyManager.getProperty(context, zprop)
    return properties