本文整理汇总了Python中Products.PluginRegistry.PluginRegistry.PluginRegistry._plugins方法的典型用法代码示例。如果您正苦于以下问题:Python PluginRegistry._plugins方法的具体用法?Python PluginRegistry._plugins怎么用?Python PluginRegistry._plugins使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Products.PluginRegistry.PluginRegistry.PluginRegistry
的用法示例。
在下文中一共展示了PluginRegistry._plugins方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: _makePlugins
# 需要导入模块: from Products.PluginRegistry.PluginRegistry import PluginRegistry [as 别名]
# 或者: from Products.PluginRegistry.PluginRegistry.PluginRegistry import _plugins [as 别名]
def _makePlugins(self, plugin_type_info=None):
from Products.PluggableAuthService.PluggableAuthService \
import _PLUGIN_TYPE_INFO
from Products.PluginRegistry.PluginRegistry import PluginRegistry
if plugin_type_info is None:
plugin_type_info = _PLUGIN_TYPE_INFO
reg = PluginRegistry(plugin_type_info=plugin_type_info)
reg._setId('plugins')
reg._plugins = {}
return reg
示例2: _initRegistry
# 需要导入模块: from Products.PluginRegistry.PluginRegistry import PluginRegistry [as 别名]
# 或者: from Products.PluginRegistry.PluginRegistry.PluginRegistry import _plugins [as 别名]
def _initRegistry(self, plugin_type_info=(), plugins={}):
from OFS.Folder import Folder
from OFS.SimpleItem import SimpleItem
from Products.PluginRegistry.PluginRegistry import PluginRegistry
app = Folder()
app.getPhysicalPath = lambda: ()
app.getPhysicalRoot = lambda: app
app._setObject('foo_plugin_1', SimpleItem())
app._setObject('foo_plugin_2', SimpleItem())
registry = PluginRegistry(plugin_type_info)
registry._plugins = {} # it is usually lazy
for plugin_type, registered in plugins.items():
registry._plugins[plugin_type] = registered
app._setObject('plugin_registry', registry)
registry = app._getOb('plugin_registry')
return app, registry