當前位置: 首頁>>代碼示例>>Python>>正文


Python PropertyManager.PropertyManager類代碼示例

本文整理匯總了Python中OFS.PropertyManager.PropertyManager的典型用法代碼示例。如果您正苦於以下問題:Python PropertyManager類的具體用法?Python PropertyManager怎麽用?Python PropertyManager使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。


在下文中一共展示了PropertyManager類的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。

示例1: _updateProperty

    def _updateProperty( self, id, value ):

        if id == 'predicate':
            self._setPredicate( value )

        else:
            PropertyManager._updateProperty( self, id, value )
開發者ID:goschtl,項目名稱:zope,代碼行數:7,代碼來源:DynamicGroupsPlugin.py

示例2: _delProperty

 def _delProperty(self, id):
     """ Extends the PropertyManager method of the same name.
     
     """
     PropertyManager._delProperty(self, id)
     if self._property_mapping.has_key(id):
         self._p_changed = 1
         mp = self._property_mapping[id]
         del(self._property_mapping[id])
開發者ID:groupserver,項目名稱:Products.CustomProperties,代碼行數:9,代碼來源:CustomProperties.py

示例3: getProperty

 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)
開發者ID:zenoss,項目名稱:zenoss-prodbin,代碼行數:7,代碼來源:ZenPropertyManager.py

示例4: _updateProperty

 def _updateProperty(self, id, value):
     """ Hook for updating a particular property.
     
     """
     self._p_changed = 1
     # the check method should return the value to be stored or
     # raise an Exception
     check_method = getattr(self, 'check_%s' % id, None)
     if check_method:
         value = check_method(value)
     # use the regular property sheets storage
     PropertyManager._updateProperty(self, id, value)
     
     # run a reindex if we are CatalogAware
     if hasattr(self, 'reindex_object'):
         self.reindex_object()
開發者ID:groupserver,項目名稱:Products.CustomProperties,代碼行數:16,代碼來源:CustomProperties.py

示例5: hasProperty

 def hasProperty(self, id, useAcquisition=False):
     """Override method in PropertyManager to support acquisition.
     """
     if useAcquisition:
         hasProp = self._findParentWithProperty(id) is not None
     else:
         hasProp = PropertyManager.hasProperty(self, id)
     return hasProp
開發者ID:zenoss,項目名稱:zenoss-prodbin,代碼行數:8,代碼來源:ZenPropertyManager.py

示例6: manage_editProperties

    def manage_editProperties(self,first_day_week,REQUEST=None):
        """ Manage the edited values """

        if first_day_week == 'Monday':
            calendar.setfirstweekday(0)
        else:
            calendar.setfirstweekday(6)
        self.ZCacheable_invalidate()
        return PropertyManager.manage_editProperties(self,REQUEST)
開發者ID:eaudeweb,項目名稱:naaya,代碼行數:9,代碼來源:RDFCalendar.py

示例7: getPropertyType

 def getPropertyType(self, id):
     """
     Overrides methods from PropertyManager to support acquistion.
     """
     ob = self._findParentWithProperty(id)
     if ob is None:
         type = None
     else:
         type = PropertyManager.getPropertyType(ob, id)
     return type
開發者ID:bbc,項目名稱:zenoss-prodbin,代碼行數:10,代碼來源:ZenPropertyManager.py

示例8: getZProperties

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
開發者ID:bbc,項目名稱:zenoss-prodbin,代碼行數:14,代碼來源:utils.py

示例9: afterSetUp

 def afterSetUp(self):
     self.props = PropertyManager()
     # PropertyManager has title property already
     self.props.manage_changeProperties(title = 'Player properties')
     self.props.manage_addProperty('plugins/controls/url', '${portal_path}flowplayer.controls.swf', 'string')
     self.props.manage_addProperty('plugins/controls/all', False, 'boolean')
     self.props.manage_addProperty('plugins/controls/play', True, 'boolean')
     self.props.manage_addProperty('plugins/controls/scrubber', True, 'boolean')
     self.props.manage_addProperty('plugins/controls/tooltips/fullscreen', 'Enter fullscreen mode', 'string')
     self.props.manage_addProperty('plugins/controls/tooltips/buttons', True, 'boolean')
     self.props.manage_addProperty('plugins/audio/url', '${portal_url}++resource++collective.flowplayer/flowplayer.audio.swf', 'string')
     self.props.manage_addProperty('clip/autoPlay',False, 'boolean')
     self.props.manage_addProperty('clip/autoBuffering', True, 'boolean')
     self.props.manage_addProperty('param/src', 'flowplayer.swf', 'string')
     self.props.manage_addProperty('param/wmode', 'opaque', 'string')
開發者ID:FHNW,項目名稱:collective.flowplayer,代碼行數:15,代碼來源:test_utils.py

示例10: manage_changeProperties

 def manage_changeProperties(self, REQUEST=None, **kw):
     result = PropertyManager.manage_changeProperties(self, REQUEST, **kw)
     self.reindex_object()
     return result
開發者ID:Rhaptos,項目名稱:Products.RhaptosCollaborationTool,代碼行數:4,代碼來源:CollaborationFolder.py

示例11: TestUtils

class TestUtils(ZopeTestCase.ZopeTestCase):
    
    def afterSetUp(self):
        self.props = PropertyManager()
        # PropertyManager has title property already
        self.props.manage_changeProperties(title = 'Player properties')
        self.props.manage_addProperty('plugins/controls/url', '${portal_path}flowplayer.controls.swf', 'string')
        self.props.manage_addProperty('plugins/controls/all', False, 'boolean')
        self.props.manage_addProperty('plugins/controls/play', True, 'boolean')
        self.props.manage_addProperty('plugins/controls/scrubber', True, 'boolean')
        self.props.manage_addProperty('plugins/controls/tooltips/fullscreen', 'Enter fullscreen mode', 'string')
        self.props.manage_addProperty('plugins/controls/tooltips/buttons', True, 'boolean')
        self.props.manage_addProperty('plugins/audio/url', '${portal_url}++resource++collective.flowplayer/flowplayer.audio.swf', 'string')
        self.props.manage_addProperty('clip/autoPlay',False, 'boolean')
        self.props.manage_addProperty('clip/autoBuffering', True, 'boolean')
        self.props.manage_addProperty('param/src', 'flowplayer.swf', 'string')
        self.props.manage_addProperty('param/wmode', 'opaque', 'string')
    
    def test_parsing(self):
        parsed = properties_to_dict(self.props, 'http://localhost', ignore=['title'])
        self.assertEqual(len(parsed.keys()), 2) # plugins, clip
        self.assertEqual(len(parsed['plugins'].keys()), 2) # controls, audio
        self.assertEqual(parsed['plugins']['controls']['all'], False) 
        self.assertEqual(parsed['plugins']['controls']['scrubber'], True) 
        self.assertEqual(parsed['plugins']['controls']['url'], r'http%3A//localhost/flowplayer.controls.swf') 
        self.assertEqual(parsed['plugins']['audio']['url'], r'http%3A//localhost/%2B%2Bresource%2B%2Bcollective.flowplayer/flowplayer.audio.swf') 
        self.assertEqual(parsed['clip']['autoBuffering'], True) 
        self.failIf(parsed.has_key('param'))
        
    def test_parsing_flash_props(self):
        parsed = flash_properties_to_dict(self.props, 'http://localhost')
        self.assertEqual(len(parsed.keys()), 2) # src, wmode
        self.assertEqual(parsed['src'], 'flowplayer.swf')
        self.assertEqual(parsed['wmode'], 'opaque')
開發者ID:FHNW,項目名稱:collective.flowplayer,代碼行數:34,代碼來源:test_utils.py

示例12: manage_changeProperties

 def manage_changeProperties(self, **kwargs):
     """Ensure the SQL methods get regenerated."""
     self.delSQLQueries()
     PropertyManager.manage_changeProperties(self, **kwargs)
     self.addSQLQueries()
開發者ID:dtgit,項目名稱:dtedu,代碼行數:5,代碼來源:sql.py

示例13: setUp

    def setUp(self):
        from OFS.PropertyManager import PropertyManager

        obj = PropertyManager('obj')
        obj.foobarbaz = ('Foo', 'Bar', 'Baz')
        obj._properties = ()
        obj.manage_addProperty('foo_boolean', '', 'boolean')
        obj.manage_addProperty('foo_date', '1970/01/01', 'date')
        obj.manage_addProperty('foo_float', '0', 'float')
        obj.manage_addProperty('foo_int', '0', 'int')
        obj.manage_addProperty('foo_lines', '', 'lines')
        obj.manage_addProperty('foo_long', '0', 'long')
        obj.manage_addProperty('foo_string', '', 'string')
        obj.manage_addProperty('foo_text', '', 'text')
        obj.manage_addProperty('foo_tokens', '', 'tokens')
        obj.manage_addProperty('foo_selection', 'foobarbaz', 'selection')
        obj.manage_addProperty('foo_mselection', 'foobarbaz',
                               'multiple selection')
        obj.manage_addProperty('foo_boolean0', '', 'boolean')
        obj.manage_addProperty('foo_ro', '', 'string')
        obj._properties[-1]['mode'] = '' # Read-only, not exported or purged
        obj.manage_addProperty('foo_int_nodel', 0, 'int')
        obj._properties[-1]['mode'] = 'w' # Not deletable
        obj.manage_addProperty('foo_float_nodel', 0, 'float')
        obj._properties[-1]['mode'] = 'w' # Not deletable
        obj.manage_addProperty('foo_boolean_nodel', '', 'boolean')
        obj._properties[-1]['mode'] = 'w' # Not deletable
        self.helpers = self._makeOne(obj, DummySetupEnviron())
開發者ID:dtgit,項目名稱:dtedu,代碼行數:28,代碼來源:test_utils.py

示例14: manage_editProperties

 def manage_editProperties(self, REQUEST):
     """Change properties from ZMI"""
     result = PropertyManager.manage_editProperties(self, REQUEST)
     self.reindex_object()
     return result
開發者ID:Rhaptos,項目名稱:Products.RhaptosCollaborationTool,代碼行數:5,代碼來源:CollaborationFolder.py

示例15: _setPropValue

 def _setPropValue(self, id, value):
     PropertyManager._setPropValue(self, id, value)
     self.ZCacheable_invalidate()
開發者ID:OS2World,項目名稱:APP-SERVER-Zope,代碼行數:3,代碼來源:ZopePageTemplate.py


注:本文中的OFS.PropertyManager.PropertyManager類示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。