kolibri/utils/cli.py
def plugin(plugin_name, **kwargs):
    """
    Receives a plugin identifier and tries to load its main class. Calls class
    functions.
    """
    from kolibri.utils import conf

    if kwargs.get("enable", False):
        plugin_classes = get_kolibri_plugin(plugin_name)
        for klass in plugin_classes:
            klass.enable()

    if kwargs.get("disable", False):
        try:
            plugin_classes = get_kolibri_plugin(plugin_name)
            for klass in plugin_classes:
                klass.disable()
        except PluginDoesNotExist as e:
            logger.error(str(e))
            logger.warning(
                "Removing '{}' from configuration in a naive way.".format(plugin_name)
            )
            if plugin_name in conf.config["INSTALLED_APPS"]:
                conf.config["INSTALLED_APPS"].remove(plugin_name)
                logger.info("Removed '{}' from INSTALLED_APPS".format(plugin_name))
            else:
                logger.warning(
                    (
                        "Could not find any matches for {} in INSTALLED_APPS".format(
                            plugin_name
                        )
                    )
                )

    conf.save()

    Receives a plugin identifier and tries to load its main class. Calls class
    functions.
    
Receives a plugin identifier and tries to load its main class. Calls class
functions.
Receives a plugin identifier and tries to load its main class . Calls class functions .
def plugin(plugin_name, **kwargs):
    from kolibri.utils import conf
    if kwargs.get("enable", False):
        plugin_classes = get_kolibri_plugin(plugin_name)
        for klass in plugin_classes:
            klass.enable()
    if kwargs.get("disable", False):
        try:
            plugin_classes = get_kolibri_plugin(plugin_name)
            for klass in plugin_classes:
                klass.disable()
        except PluginDoesNotExist as e:
            logger.error(str(e))
            logger.warning(
                "Removing '{}' from configuration in a naive way.".format(plugin_name)
            )
            if plugin_name in conf.config["INSTALLED_APPS"]:
                conf.config["INSTALLED_APPS"].remove(plugin_name)
                logger.info("Removed '{}' from INSTALLED_APPS".format(plugin_name))
            else:
                logger.warning(
                    (
                        "Could not find any matches for {} in INSTALLED_APPS".format(
                            plugin_name
                        )
                    )
                )
    conf.save()
def plugin ( plugin_name , ** kwargs ) : from kolibri . utils import conf if kwargs . get ( "enable" , False ) : plugin_classes = get_kolibri_plugin ( plugin_name ) for klass in plugin_classes : klass . enable ( ) if kwargs . get ( "disable" , False ) : try : plugin_classes = get_kolibri_plugin ( plugin_name ) for klass in plugin_classes : klass . disable ( ) except PluginDoesNotExist as e : logger . error ( str ( e ) ) logger . warning ( "Removing '{}' from configuration in a naive way." . format ( plugin_name ) ) if plugin_name in conf . config [ "INSTALLED_APPS" ] : conf . config [ "INSTALLED_APPS" ] . remove ( plugin_name ) logger . info ( "Removed '{}' from INSTALLED_APPS" . format ( plugin_name ) ) else : logger . warning ( ( "Could not find any matches for {} in INSTALLED_APPS" . format ( plugin_name ) ) ) conf . save ( )
Receives a plugin identifier and tries to load its main class.
Receives a plugin identifier and tries to load its main class .
"""
    Receives a plugin identifier and tries to load its main class. Calls class
    functions.
    """
plugin_name