本文整理汇总了Python中invenio.pluginutils.PluginContainer.disable_plugin方法的典型用法代码示例。如果您正苦于以下问题:Python PluginContainer.disable_plugin方法的具体用法?Python PluginContainer.disable_plugin怎么用?Python PluginContainer.disable_plugin使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类invenio.pluginutils.PluginContainer
的用法示例。
在下文中一共展示了PluginContainer.disable_plugin方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: load_ticket_plugins
# 需要导入模块: from invenio.pluginutils import PluginContainer [as 别名]
# 或者: from invenio.pluginutils.PluginContainer import disable_plugin [as 别名]
def load_ticket_plugins():
"""
Will load all the ticket plugins found under CFG_BIBCATALOG_PLUGIN_DIR.
Returns a tuple of plugin_object, list of errors.
"""
# TODO add to configfile
CFG_BIBCATALOG_PLUGIN_DIR = os.path.join(CFG_PYLIBDIR,
"invenio",
"bibcatalog_ticket_templates",
"*.py")
# Load plugins
plugins = PluginContainer(CFG_BIBCATALOG_PLUGIN_DIR,
plugin_builder=_bibcatalog_plugin_builder)
# Remove __init__ if applicable
try:
plugins.disable_plugin("__init__")
except KeyError:
pass
error_messages = []
# Check for broken plug-ins
broken = plugins.get_broken_plugins()
if broken:
error_messages = []
for plugin, info in broken.items():
error_messages.append("Failed to load %s:\n"
" %s" % (plugin, "".join(traceback.format_exception(*info))))
return plugins, error_messages