Ejemplo n.º 1
0
def install_plugin(plugin):
    plugin = get_plugin_from_all(plugin)
    if plugin.installable and not plugin.uninstallable:
        plugin.install()
        flash("Plugin {} has been installed.".format(plugin.name), "success")
    else:
        flash("Cannot install Plugin {}".format(plugin.name), "danger")

    return redirect(url_for("admin.plugins"))
Ejemplo n.º 2
0
def install_plugin(plugin):
    plugin = get_plugin_from_all(plugin)
    if plugin.installable and not plugin.uninstallable:
        plugin.install()
        Setting.invalidate_cache()

        flash("Plugin {} has been installed.".format(plugin.name), "success")
    else:
        flash("Cannot install Plugin {}".format(plugin.name), "danger")

    return redirect(url_for("management.plugins"))
Ejemplo n.º 3
0
def install_plugin(plugin):
    plugin = get_plugin_from_all(plugin)
    if plugin.installable and not plugin.uninstallable:
        plugin.install()
        Setting.invalidate_cache()

        flash("Plugin {} has been installed.".format(plugin.name), "success")
    else:
        flash("Cannot install Plugin {}".format(plugin.name), "danger")

    return redirect(url_for("management.plugins"))
Ejemplo n.º 4
0
def enable_plugin(plugin):
    plugin = get_plugin_from_all(plugin)
    if not plugin.enabled:
        plugin_dir = os.path.join(
            os.path.abspath(os.path.dirname(os.path.dirname(__file__))),
            "plugins", plugin.identifier)

        disabled_file = os.path.join(plugin_dir, "DISABLED")

        os.remove(disabled_file)

        flash("Plugin should be enabled. Please reload your app.", "success")

        flash(
            "If you are using a host which doesn't support writting on the "
            "disk, this won't work - than you need to delete the "
            "'DISABLED' file by yourself.", "info")
    else:
        flash("Plugin is not enabled", "danger")

    return redirect(url_for("management.plugins"))
Ejemplo n.º 5
0
def enable_plugin(plugin):
    plugin = get_plugin_from_all(plugin)
    if not plugin.enabled:
        plugin_dir = os.path.join(
            os.path.abspath(os.path.dirname(os.path.dirname(__file__))),
            "plugins", plugin.identifier
        )

        disabled_file = os.path.join(plugin_dir, "DISABLED")

        os.remove(disabled_file)

        flash("Plugin should be enabled. Please reload your app.", "success")

        flash("If you are using a host which doesn't support writting on the "
              "disk, this won't work - than you need to delete the "
              "'DISABLED' file by yourself.", "info")
    else:
        flash("Plugin is not enabled", "danger")

    return redirect(url_for("management.plugins"))