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


Python PluginContainer.get方法代码示例

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


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

示例1: setUp

# 需要导入模块: from invenio.pluginutils import PluginContainer [as 别名]
# 或者: from invenio.pluginutils.PluginContainer import get [as 别名]
 def setUp(self):
     """Load plugin."""
     search_service_plugins = PluginContainer(
         os.path.join(CFG_SEARCH_SERVICES_PATH, '*Service.py'),
         api_version=__required_plugin_API_version__,
         plugin_signature=SearchService
     )
     self.plugin = search_service_plugins.get('JournalHintService')()
开发者ID:aw-bib,项目名称:tind-invenio,代码行数:10,代码来源:websearch_services_unit_tests.py

示例2: test_plugin_container_wrapping_websubmit_functions

# 需要导入模块: from invenio.pluginutils import PluginContainer [as 别名]
# 或者: from invenio.pluginutils.PluginContainer import get [as 别名]
    def test_plugin_container_wrapping_websubmit_functions(self):
        """pluginutils - wrapping websubmit functions"""
        websubmit_functions = PluginContainer(os.path.join(CFG_PYLIBDIR, 'invenio', 'websubmit_functions', '*.py'))

        self.failUnless(websubmit_functions['Is_Referee'])
        self.failUnless(websubmit_functions['CaseEDS'])
        self.failUnless(callable(websubmit_functions['CaseEDS']))
        self.failUnless(len(websubmit_functions) >= 62)
        ## Retrieve_Data and Shared_Functions are not real plugins
        self.failUnless(len(websubmit_functions.get_broken_plugins()) >= 2)
        self.failIf(websubmit_functions.get('Shared_Functions'))
        self.failUnless('Shared_Functions' in websubmit_functions.get_broken_plugins())
开发者ID:metandrey,项目名称:invenio-metandrey,代码行数:14,代码来源:pluginutils_tests.py

示例3: test_plugin_container_wrapping_websubmit_functions

# 需要导入模块: from invenio.pluginutils import PluginContainer [as 别名]
# 或者: from invenio.pluginutils.PluginContainer import get [as 别名]
    def test_plugin_container_wrapping_websubmit_functions(self):
        """pluginutils - wrapping websubmit functions"""
        websubmit_functions = PluginContainer(os.path.join(CFG_PYLIBDIR, "invenio", "websubmit_functions", "*.py"))

        self.failUnless(websubmit_functions["Is_Referee"])
        self.failUnless(websubmit_functions["CaseEDS"])
        self.failUnless(callable(websubmit_functions["CaseEDS"]))
        self.failUnless(
            len(websubmit_functions) >= 62,
            "There should exist at least 62 websubmit_functions. Found: %s" % len(websubmit_functions),
        )
        ## Retrieve_Data and Shared_Functions are not real plugins
        self.failUnless(len(websubmit_functions.get_broken_plugins()) >= 2)
        self.failIf(websubmit_functions.get("Shared_Functions"))
        self.failUnless("Shared_Functions" in websubmit_functions.get_broken_plugins())
开发者ID:adsabs,项目名称:invenio,代码行数:17,代码来源:pluginutils_unit_tests.py

示例4: test_plugin_container_wrapping_external_authentications

# 需要导入模块: from invenio.pluginutils import PluginContainer [as 别名]
# 或者: from invenio.pluginutils.PluginContainer import get [as 别名]
    def test_plugin_container_wrapping_external_authentications(self):
        """pluginutils - wrapping external authentications"""
        def plugin_builder(plugin_name, plugin_code):
            for name in dir(plugin_code):
                candidate = getattr(plugin_code, name)
                try:
                    if issubclass(candidate, ExternalAuth):
                        return candidate
                except TypeError:
                    pass
            raise ValueError('%s is not a valid external authentication plugin' % plugin_name)

        external_authentications = PluginContainer(os.path.join(CFG_PYLIBDIR, 'invenio', 'external_authentication_*.py'), plugin_signature=ExternalAuth, plugin_builder=plugin_builder)
        self.failUnless(issubclass(external_authentications['external_authentication_sso'], ExternalAuth))
        self.failIf(external_authentications.get('external_authentication_cern_wrapper'))
        self.failUnless(len(external_authentications) >= 1)
        self.failUnless(len(external_authentications.get_broken_plugins()) >= 2)
开发者ID:metandrey,项目名称:invenio-metandrey,代码行数:19,代码来源:pluginutils_tests.py


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