当前位置: 首页>>代码示例>>Python>>正文


Python ActionInformation.ActionInformation类代码示例

本文整理汇总了Python中Products.CMFCore.ActionInformation.ActionInformation的典型用法代码示例。如果您正苦于以下问题:Python ActionInformation类的具体用法?Python ActionInformation怎么用?Python ActionInformation使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


在下文中一共展示了ActionInformation类的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: test_Condition

 def test_Condition(self):
     portal = self.portal 
     folder = self.folder
     object = self.object 
     ai = ActionInformation(id='view'
                          , title='View'
                          , action=Expression(
          text='view')
                          , condition=Expression(
          text='member')
                          , category='global'
                          , visible=1)
     ec = createExprContext(folder, portal, object)
     self.failIf(ai.testCondition(ec))
开发者ID:goschtl,项目名称:zope,代码行数:14,代码来源:test_ActionInformation.py

示例2: test_editing

 def test_editing(self):
     ai = ActionInformation(id='view',
                            category='folder',
                           )
     ai.edit(id='new_id', title='blah')
     self.assertEqual(ai.getId(), 'new_id')
     self.assertEqual(ai.Title(), 'blah')
     self.assertEqual(ai.Description(), '')
     self.assertEqual(ai.getCondition(), '')
     self.assertEqual(ai.getActionExpression(), '')
     self.assertEqual(ai.getVisibility(), 1)
     self.assertEqual(ai.getCategory(), 'folder')
     self.assertEqual(ai.getPermissions(), ())
开发者ID:goschtl,项目名称:zope,代码行数:13,代码来源:test_ActionInformation.py

示例3: test_basic_construction

 def test_basic_construction(self):
     ai = ActionInformation(id='view'
                           )
     self.assertEqual(ai.getId(), 'view')
     self.assertEqual(ai.Title(), 'view')
     self.assertEqual(ai.Description(), '')
     self.assertEqual(ai.getCondition(), '')
     self.assertEqual(ai.getActionExpression(), '')
     self.assertEqual(ai.getVisibility(), 1)
     self.assertEqual(ai.getCategory(), 'object')
     self.assertEqual(ai.getPermissions(), ())
开发者ID:goschtl,项目名称:zope,代码行数:11,代码来源:test_ActionInformation.py

示例4: _importOldAction

    def _importOldAction(self, old_action):
      """Convert a CMF action to an ERP5 action

      This is used to update an existing site or to import a BT.
      """
      import erp5.portal_type
      ActionInformation = getattr(erp5.portal_type, 'Action Information')
      old_action = old_action.__getstate__()
      action_type = old_action.pop('category', None)
      action = ActionInformation(self.generateNewId())
      for k, v in old_action.iteritems():
        if k in ('action', 'condition', 'icon'):
          if not v:
            continue
          v = v.__class__(v.text)
        setattr(action, {'id': 'reference',
                         'priority': 'float_index',
                         'permissions': 'action_permission',
                        }.get(k, k), v)
      action.uid = None
      action = self[self._setObject(action.id, action, set_owner=0)]
      if action_type:
        action._setCategoryMembership('action_type', action_type)
      return action
开发者ID:ccwalkerjm,项目名称:erp5,代码行数:24,代码来源:ERP5Type.py

示例5: _importOldAction

    def _importOldAction(self, old_action):
        """Convert a CMF action to an ERP5 action

      This is used to update an existing site or to import a BT.
      """
        import erp5.portal_type

        ActionInformation = getattr(erp5.portal_type, "Action Information")
        old_action = old_action.__getstate__()
        action_type = old_action.pop("category", None)
        action = ActionInformation(self.generateNewId())
        for k, v in old_action.iteritems():
            if k in ("action", "condition", "icon"):
                if not v:
                    continue
                v = v.__class__(v.text)
            setattr(
                action, {"id": "reference", "priority": "float_index", "permissions": "action_permission"}.get(k, k), v
            )
        action.uid = None
        action = self[self._setObject(action.id, action, set_owner=0)]
        if action_type:
            action._setCategoryMembership("action_type", action_type)
        return action
开发者ID:Provab-Solutions,项目名称:erp5,代码行数:24,代码来源:ERP5Type.py

示例6: test_construction_with_Expressions

 def test_construction_with_Expressions(self):
     ai = ActionInformation(id='view'
                          , title='View'
                          , action=Expression(
          text='view')
                          , condition=Expression(
          text='member')
                          , category='global'
                          , visible=0)
     self.assertEqual(ai.getId(), 'view')
     self.assertEqual(ai.Title(), 'View')
     self.assertEqual(ai.Description(), '')
     self.assertEqual(ai.getCondition(), 'member')
     self.assertEqual(ai.getActionExpression(), 'string:view')
     self.assertEqual(ai.getVisibility(), 0)
     self.assertEqual(ai.getCategory(), 'global')
     self.assertEqual(ai.getPermissions(), ())
开发者ID:goschtl,项目名称:zope,代码行数:17,代码来源:test_ActionInformation.py

示例7: getAction

 def getAction(self, ec):
     res = ActionInformation.getAction(self, ec)
     res['description'] = self.getDescription()
     return res
开发者ID:erral,项目名称:Products.CMFPlone,代码行数:4,代码来源:PloneControlPanel.py

示例8: __init__

 def __init__(self, appId, **kwargs):
     self.appId = appId
     ActionInformation.__init__(self, **kwargs)
开发者ID:erral,项目名称:Products.CMFPlone,代码行数:3,代码来源:PloneControlPanel.py


注:本文中的Products.CMFCore.ActionInformation.ActionInformation类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。