code style reformatting using black

This commit is contained in:
Goffi 2018-06-27 20:14:46 +02:00
commit 744cb0c503

View file

@ -24,9 +24,9 @@ from sat.tools.common.ansi import ANSI as A
import json
__outputs__ = ["Simple", "Json"]
SIMPLE = u'simple'
JSON = u'json'
JSON_RAW = u'json_raw'
SIMPLE = u"simple"
JSON = u"json"
JSON_RAW = u"json_raw"
class Simple(object):
@ -45,27 +45,30 @@ class Simple(object):
self.host.disp(unicode(data))
def list(self, data):
self.host.disp(u'\n'.join(data))
self.host.disp(u"\n".join(data))
def dict(self, data, indent=0, header_color=C.A_HEADER):
options = self.host.parse_output_options()
self.host.check_output_options({u'no-header'}, options)
show_header = not u'no-header' in options
self.host.check_output_options({u"no-header"}, options)
show_header = not u"no-header" in options
for k, v in data.iteritems():
if show_header:
header = A.color(header_color, k) + u': '
header = A.color(header_color, k) + u": "
else:
header = u''
header = u""
self.host.disp((u'{indent}{header}{value}'.format(
indent=indent*u' ',
header=header,
value=v)))
self.host.disp(
(
u"{indent}{header}{value}".format(
indent=indent * u" ", header=header, value=v
)
)
)
def list_dict(self, data):
for idx, datum in enumerate(data):
if idx:
self.host.disp(u'\n')
self.host.disp(u"\n")
self.dict(datum)
def dict_dict(self, data):