How to use the pluginbase.get_plugin_source 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 / tests / test_basics.py View on Github external
# A module can always find its own source as well (the hello module
    # calls get_plugin_source() itself).
    with source:
        from dummy.plugins import hello
    assert hello.get_plugin_source() is source

    # Last but not least the plugin source can be found by module names
    # (in a plugin source block by the import name and in any case by
    # the internal name)
    with source:
        assert get_plugin_source('dummy.plugins.hello') is source
    assert get_plugin_source(hello.__name__) is source

    # As well as by module object.
    assert get_plugin_source(hello) is source
github mitsuhiko / pluginbase / tests / test_basics.py View on Github external
# Inside a source block we can find the source through mere calling.
    with source:
        assert get_plugin_source() is source

    # A module can always find its own source as well (the hello module
    # calls get_plugin_source() itself).
    with source:
        from dummy.plugins import hello
    assert hello.get_plugin_source() is source

    # Last but not least the plugin source can be found by module names
    # (in a plugin source block by the import name and in any case by
    # the internal name)
    with source:
        assert get_plugin_source('dummy.plugins.hello') is source
    assert get_plugin_source(hello.__name__) is source

    # As well as by module object.
    assert get_plugin_source(hello) is source
github mitsuhiko / pluginbase / tests / test_basics.py View on Github external
# Inside a source block we can find the source through mere calling.
    with source:
        assert get_plugin_source() is source

    # A module can always find its own source as well (the hello module
    # calls get_plugin_source() itself).
    with source:
        from dummy.plugins import hello
    assert hello.get_plugin_source() is source

    # Last but not least the plugin source can be found by module names
    # (in a plugin source block by the import name and in any case by
    # the internal name)
    with source:
        assert get_plugin_source('dummy.plugins.hello') is source
    assert get_plugin_source(hello.__name__) is source

    # As well as by module object.
    assert get_plugin_source(hello) is source
github mitsuhiko / pluginbase / tests / test_basics.py View on Github external
def test_fetching_plugin_source(source):
    # Finding the plugin source outside of a plugin and without a with
    # block of a plugin source returns None.
    assert get_plugin_source() is None

    # Inside a source block we can find the source through mere calling.
    with source:
        assert get_plugin_source() is source

    # A module can always find its own source as well (the hello module
    # calls get_plugin_source() itself).
    with source:
        from dummy.plugins import hello
    assert hello.get_plugin_source() is source

    # Last but not least the plugin source can be found by module names
    # (in a plugin source block by the import name and in any case by
    # the internal name)
    with source:
        assert get_plugin_source('dummy.plugins.hello') is source
    assert get_plugin_source(hello.__name__) is source

    # As well as by module object.
    assert get_plugin_source(hello) is source

pluginbase

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

BSD-2-Clause
Latest version published 4 years ago

Package Health Score

58 / 100
Full package analysis