Mercurial > libervia-backend
diff sat_frontends/jp/output_std.py @ 2624:56f94936df1e
code style reformatting using black
author | Goffi <goffi@goffi.org> |
---|---|
date | Wed, 27 Jun 2018 20:14:46 +0200 |
parents | 26edcf3a30eb |
children | b156b78b8f9a |
line wrap: on
line diff
--- a/sat_frontends/jp/output_std.py Wed Jun 27 07:51:29 2018 +0200 +++ b/sat_frontends/jp/output_std.py Wed Jun 27 20:14:46 2018 +0200 @@ -24,9 +24,9 @@ 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 @@ 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):