Exemplo n.º 1
0
    def handle(self, *args, **options):
    	"""
        Loads a new resource plugin
        """

        # Check arguments
        if len(args) != 1:
            raise CommandError("Error: Please specify the path to the plugin package")

        plugin_id = None
        try:
            path = args[0]
            # Load plugin
            plugin_loader = PluginLoader()
            plugin_id = plugin_loader.install_plugin(path)
        except Exception as e:
            raise CommandError(unicode(e))

        self.stdout.write("Your plugin has been loaded with id: " + plugin_id + "\n")
        self.stdout.write("If you want to retrieve the existing plugins, execute: python manage.py listplugins\n")
Exemplo n.º 2
0
    def handle(self, *args, **options):
        """
        Loads a new resource plugin
        """

        # Check arguments
        if len(args) < 1:
            raise CommandError("Error: Please specify the plugin to be deleted")
        elif len(args) > 1:
            raise CommandError("Error: Please specify only one plugin to be deleted")

        try:
            name = args[0]
            # Load plugin
            plugin_loader = PluginLoader()
            plugin_loader.uninstall_plugin(name)
        except Exception as e:
            raise CommandError(unicode(e))

        self.stdout.write("The plugin has been removed\n")
Exemplo n.º 3
0
    def handle(self, *args, **options):
        """
        Loads a new resource plugin
        """

        # Check arguments
        if len(args) < 1:
            raise CommandError(
                "Error: Please specify the plugin to be deleted")
        elif len(args) > 1:
            raise CommandError(
                "Error: Please specify only one plugin to be deleted")

        try:
            name = args[0]
            # Load plugin
            plugin_loader = PluginLoader()
            plugin_loader.uninstall_plugin(name)
        except Exception as e:
            raise CommandError(unicode(e))

        self.stdout.write("The plugin has been removed\n")
Exemplo n.º 4
0
    def handle(self, *args, **options):
        """
        Loads a new resource plugin
        """

        # Check arguments
        if len(args) != 1:
            raise CommandError(
                "Error: Please specify the path to the plugin package")

        plugin_id = None
        try:
            path = args[0]
            # Load plugin
            plugin_loader = PluginLoader()
            plugin_id = plugin_loader.install_plugin(path)
        except Exception as e:
            raise CommandError(unicode(e))

        self.stdout.write("Your plugin has been loaded with id: " + plugin_id +
                          "\n")
        self.stdout.write(
            "If you want to retrieve the existing plugins, execute: python manage.py listplugins\n"
        )