Пример #1
0
def install_plugin_by_id(plugin_id, repo_id=None):
    """
    Install a plugin given its Plugin ID

    :param plugin_id:
    :param repo_id:
    :return:
    """

    # Fetch a list of plugin data cached locally
    plugins = PluginsHandler()
    return plugins.install_plugin_by_id(plugin_id, repo_id)
Пример #2
0
    def install_plugin_by_id(self, *args, **kwargs):
        plugin_id = self.get_argument('plugin_id')

        # Fetch a list of plugin data cached locally
        plugins = PluginsHandler()
        success = plugins.install_plugin_by_id(plugin_id)

        if success:
            # Return success
            self.write(json.dumps({"success": True}))
        else:
            # Return failure
            self.write(json.dumps({"success": False}))