

def load_extension(self, ext_module):
    "\n        Given an extension module name, load or in other-words 'import' the\n        extension.\n\n        :param ext_module: The extension module name.  For example:\n            'cement.ext.ext_logging'.\n        :type ext_module: ``str``\n        :raises: cement.core.exc.FrameworkError\n\n        "
    if (ext_module.find('.') == (- 1)):
        ext_module = ('cement.ext.ext_%s' % ext_module)
    if (ext_module in self._loaded_extensions):
        LOG.debug(("framework extension '%s' already loaded" % ext_module))
        return
    LOG.debug(("loading the '%s' framework extension" % ext_module))
    try:
        if (ext_module not in sys.modules):
            __import__(ext_module, globals(), locals(), [], 0)
        if hasattr(sys.modules[ext_module], 'load'):
            sys.modules[ext_module].load(self.app)
        if (ext_module not in self._loaded_extensions):
            self._loaded_extensions.append(ext_module)
    except ImportError as e:
        raise exc.FrameworkError(e.args[0])

dataset/ETHPy150Open datafolklabs/cement/cement/core/extension.py CementExtensionHandler.load_extension/original