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


Python PropertyManager.manage_changeProperties方法代碼示例

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


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

示例1: TestUtils

# 需要導入模塊: from OFS.PropertyManager import PropertyManager [as 別名]
# 或者: from OFS.PropertyManager.PropertyManager import manage_changeProperties [as 別名]
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,代碼行數:36,代碼來源:test_utils.py

示例2: manage_changeProperties

# 需要導入模塊: from OFS.PropertyManager import PropertyManager [as 別名]
# 或者: from OFS.PropertyManager.PropertyManager import manage_changeProperties [as 別名]
 def manage_changeProperties(self, REQUEST=None, **kw):
     result = PropertyManager.manage_changeProperties(self, REQUEST, **kw)
     self.reindex_object()
     return result
開發者ID:Rhaptos,項目名稱:Products.RhaptosCollaborationTool,代碼行數:6,代碼來源:CollaborationFolder.py

示例3: manage_changeProperties

# 需要導入模塊: from OFS.PropertyManager import PropertyManager [as 別名]
# 或者: from OFS.PropertyManager.PropertyManager import manage_changeProperties [as 別名]
 def manage_changeProperties(self, **kwargs):
     """Ensure the SQL methods get regenerated."""
     self.delSQLQueries()
     PropertyManager.manage_changeProperties(self, **kwargs)
     self.addSQLQueries()
開發者ID:dtgit,項目名稱:dtedu,代碼行數:7,代碼來源:sql.py


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