# -*- coding: utf-8 -*-
"""
    choppy_api.modules
    ~~~~~~~~~~~~~~~~~~

    Modules enable logical resource separation.

    You may control enabled modules by modifying ``ENABLED_MODULES`` config
    variable.

    :copyright: © 2019 by the Choppy team.
    :license: AGPL, see LICENSE.md for more details.
"""


def init_app(app, **kwargs):
    from importlib import import_module

    for module_name in app.config['ENABLED_MODULES']:
        import_module('.%s' % module_name, package=__name__).init_app(app, **kwargs)
