Exemplo n.º 1
0
    def run(self, cmd, opts):
        table_header = [
            "Plugin-Type", "Plugin-Name", "Version", "Author", "Summary"
        ]
        table = []

        for plugin, metainfo in iter_plugins('holland.backup'):
            row = ['backup', plugin]
            for key in ['version', 'author', 'summary']:
                row.append(metainfo.get(key, '-'))
            table.append(row)

        for plugin, metainfo in iter_plugins('holland.commands'):
            row = ['command', plugin]
            for key in ['version', 'author', 'summary']:
                row.append(metainfo.get(key, '-'))
            table.append(row)
        table.sort()
        table.insert(0, table_header)
        if len(table) == 1:
            print("No Plugins Found")
        else:
            self.print_table(table)

        return 0
Exemplo n.º 2
0
    def run(self, cmd, opts, *args):
        if args:
            print("The list-plugin command takes no arguments",
                  file=sys.stderr)
        table_header = [
            "Plugin-Type", "Plugin-Name", "Version", "Author", "Summary"
        ]
        table = []

        for plugin, metainfo in iter_plugins("holland.backup"):
            row = ["backup", plugin]
            for key in ["version", "author", "summary"]:
                row.append(metainfo.get(key, "-"))
            table.append(row)

        for plugin, metainfo in iter_plugins("holland.commands"):
            row = ["command", plugin]
            for key in ["version", "author", "summary"]:
                row.append(metainfo.get(key, "-"))
            table.append(row)
        table.sort()
        table.insert(0, table_header)
        if len(table) == 1:
            print("No Plugins Found")
        else:
            self.print_table(table)

        return 0
Exemplo n.º 3
0
    def run(self, cmd, opts):
        table_header = ["Plugin-Type", "Plugin-Name", "Version", "Author", "Summary"]
        table = []

        for plugin, metainfo in iter_plugins('holland.backup'):
            row = ['backup', plugin]
            for key in ['version','author','summary']:
                row.append(metainfo.get(key, '-'))
            table.append(row)

        for plugin, metainfo in iter_plugins('holland.commands'):
            row = ['command', plugin]
            for key in ['version','author','summary']:
                row.append(metainfo.get(key, '-'))
            table.append(row)
        table.sort()
        table.insert(0, table_header)
        if len(table) == 1:
            print "No Plugins Found"
        else:
            self.print_table(table)

        return 0