@classmethod
    def cli_resp_formatter(cls, resp):
        """Override this method to provide custom formatting of cli response.
        """
        if not resp.value:
            return ''

        if resp.status == STATUS_OK:

            if type(resp.value) in (str, bool, int, float, six.text_type):
                return str(resp.value)

            ret = ''
            val = resp.value
            if not isinstance(val, list):
                val = [val]
            for line in val:
                for k, v in line.items():
                    if isinstance(v, dict):
                        ret += cls.cli_resp_line_template.format(
                            k, '\n' + pprint.pformat(v)
                        )
                    else:
                        ret += cls.cli_resp_line_template.format(k, v)
            return ret
        else:
            return "Error: {0}".format(resp.value)
dataset/ETHPy150Open osrg/ryu/ryu/services/protocols/bgp/operator/command.py/Command.cli_resp_formatter/original