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


Python PluginsHolder.hasPluginType方法代码示例

本文整理汇总了Python中MaKaC.plugins.base.PluginsHolder.hasPluginType方法的典型用法代码示例。如果您正苦于以下问题:Python PluginsHolder.hasPluginType方法的具体用法?Python PluginsHolder.hasPluginType怎么用?Python PluginsHolder.hasPluginType使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在MaKaC.plugins.base.PluginsHolder的用法示例。


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

示例1: _checkParams

# 需要导入模块: from MaKaC.plugins.base import PluginsHolder [as 别名]
# 或者: from MaKaC.plugins.base.PluginsHolder import hasPluginType [as 别名]
 def _checkParams(self):
     optionName = self._params.get('optionName', None)
     if optionName:
         options = optionName.split('.')
         ph = PluginsHolder()
         if len(options) == 3:
             pluginType, plugin, option = options
             if ph.hasPluginType(pluginType):
                 if ph.getPluginType(pluginType).hasPlugin(plugin):
                     self._targetOption = ph.getPluginType(pluginType).getPlugin(plugin).getOption(option)
                 else:
                     raise ServiceError('ERR-PLUG4', 'plugin: ' + str(plugin) + ' does not exist')
             else:
                 raise ServiceError('ERR-PLUG3', 'pluginType: ' + str(pluginType) + ' does not exist, is not visible or not active')
         elif len(options) == 2:
             pluginType, option = options
             if ph.hasPluginType(pluginType):
                 self._targetOption = ph.getPluginType(pluginType).getOption(option)
             else:
                 raise ServiceError('ERR-PLUG3', 'pluginType: ' + str(pluginType) + ' does not exist, is not visible or not active')
         else:
             raise ServiceError('ERR-PLUG1', 'optionName argument does not have the proper pluginType.plugin.option format')
     else:
         raise ServiceError('ERR-PLUG0', 'optionName argument not present') 
开发者ID:davidmorrison,项目名称:indico,代码行数:26,代码来源:plugins.py

示例2: RHAdminPluginsBase

# 需要导入模块: from MaKaC.plugins.base import PluginsHolder [as 别名]
# 或者: from MaKaC.plugins.base.PluginsHolder import hasPluginType [as 别名]
class RHAdminPluginsBase(RHAdminBase):
    """ Base RH class for all plugin management requests.
        It will store 2 string parameters: pluginType and pluginId.
        Example: pluginType = "COllaboration" & pluginId = "EVO"
    """ 
    
    def _checkParams(self, params):
        RHAdminBase._checkParams(self, params)
        self._pluginType = params.get("pluginType", None)
        self._pluginId = params.get("pluginId", None)
        self._ph = PluginsHolder()
        if self._pluginType and not self._ph.hasPluginType(self._pluginType, mustBeActive = False):
            raise PluginError("The plugin type " + self._pluginType + " does not exist or is not visible")
        elif self._pluginType and self._pluginId and not self._ph.getPluginType(self._pluginType).hasPlugin(self._pluginId):
            raise PluginError("The plugin " + self._pluginId + " does not exist")
开发者ID:lukasnellen,项目名称:indico,代码行数:17,代码来源:admins.py


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