How to use the pluginbase._IntentionallyEmptyModule function in pluginbase

To help you get started, we’ve selected a few pluginbase examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github mitsuhiko / pluginbase / pluginbase.py View on Github external
def _setup_base_package(module_name):
    try:
        mod = __import__(module_name, None, None, ['__name__'])
    except ImportError:
        mod = None
        if '.' in module_name:
            parent_mod = __import__(module_name.rsplit('.', 1)[0],
                                    None, None, ['__name__'])
        else:
            parent_mod = None

    if mod is None:
        mod = _IntentionallyEmptyModule(module_name)
        if parent_mod is not None:
            setattr(parent_mod, module_name.rsplit('.', 1)[-1], mod)
        sys.modules[module_name] = mod

pluginbase

PluginBase is a module for Python that enables the development of flexible plugin systems in Python.

BSD-2-Clause
Latest version published 3 years ago

Package Health Score

61 / 100
Full package analysis