本文整理汇总了Python中OFS.PropertyManager.PropertyManager类的典型用法代码示例。如果您正苦于以下问题:Python PropertyManager类的具体用法?Python PropertyManager怎么用?Python PropertyManager使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了PropertyManager类的19个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的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
示例16: setUp
def setUp(self):
from OFS.PropertyManager import PropertyManager
obj = PropertyManager('obj')
obj.foobarbaz = ('Foo', 'Bar', 'Baz')
obj._properties = ()
obj._setProperty('foo_boolean', '', 'boolean')
obj._setProperty('foo_date', '', 'date')
obj._setProperty('foo_float', '', 'float')
obj._setProperty('foo_int', '', 'int')
obj._setProperty('foo_lines', '', 'lines')
obj._setProperty('foo_long', '', 'long')
obj._setProperty('foo_string', '', 'string')
obj._setProperty('foo_text', '', 'text')
obj._setProperty('foo_tokens', (), 'tokens')
obj._setProperty('foo_selection', 'foobarbaz', 'selection')
obj._setProperty('foo_mselection', 'foobarbaz', 'multiple selection')
obj._setProperty('foo_boolean0', '', 'boolean')
self.helpers = self._makeOne(obj)
开发者ID:goschtl,项目名称:zope,代码行数:19,代码来源:test_utils.py
示例17: manage_editProperties
def manage_editProperties(self, REQUEST):
"""Ensure the SQL methods get regenerated."""
self.delSQLQueries()
res = PropertyManager.manage_editProperties(self, REQUEST)
self.addSQLQueries()
return res
开发者ID:dtgit,项目名称:dtedu,代码行数:6,代码来源:sql.py
示例18: _setPropValue
def _setPropValue(self, id, value):
""" set a property and invalidate the cache """
PropertyManager._setPropValue(self, id, value)
self.ZCacheable_invalidate()
开发者ID:c0ns0le,项目名称:zenoss-4,代码行数:4,代码来源:ZopePageTemplate.py
示例19: manage_editProperties
def manage_editProperties(self, REQUEST):
""" re-render the page after changing the properties (encodings!!!) """
result = PropertyManager.manage_editProperties(self, REQUEST)
self._clear_cache()
return result
开发者ID:wpjunior,项目名称:proled,代码行数:5,代码来源:ZReST.py
注:本文中的OFS.PropertyManager.PropertyManager类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论