本文整理匯總了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