extensions.py 文件源码

python
阅读 35 收藏 0 点赞 0 评论 0

项目:masakari 作者: openstack 项目源码 文件源码
def load_extension(self, ext_factory):
        """Execute an extension factory.

        Loads an extension.  The 'ext_factory' is the name of a
        callable that will be imported and called with one
        argument--the extension manager.  The factory callable is
        expected to call the register() method at least once.
        """

        LOG.debug("Loading extension %s", ext_factory)

        if isinstance(ext_factory, six.string_types):
            # Load the factory
            factory = importutils.import_class(ext_factory)
        else:
            factory = ext_factory

        # Call it
        LOG.debug("Calling extension factory %s", ext_factory)
        factory(self)
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号