code style reformatting using black
This commit is contained in:
parent
4127bcffd0
commit
744cb0c503
1 changed files with 21394 additions and 10488 deletions
|
|
@ -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):
|
||||
|
|
|
|||
Loading…
Reference in a new issue