summaryrefslogtreecommitdiff
path: root/cliff/formatters/base.py
blob: 8634f4142a691045388d880c0a747a78ede100ac (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
"""Base classes for formatters.
"""

import abc


class Formatter(object):

    def __init__(self):
        return

    def add_argument_group(self, parser):
        """Add any options to the argument parser.

        Should use our own argument group.
        """
        return


class ListFormatter(Formatter):
    __metaclass__ = abc.ABCMeta

    @abc.abstractmethod
    def emit_list(self, column_names, data, stdout):
        """Format and print the list from the iterable data source.
        """