Skip to content

Commit

Permalink
Fix #563
Browse files Browse the repository at this point in the history
  • Loading branch information
rec committed Dec 27, 2014
1 parent b071306 commit ed16ea8
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion code/python/echomesh/command/Show.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,13 +30,16 @@ def _format(info, spaces=DEFAULT_INDENT):
s = Yaml.encode_one(info)
LOGGER.info('\n' + DEFAULT_INDENT + s.replace('\n', '\n' + DEFAULT_INDENT))

def _str(x):
return x if isinstance(x, six.string_types) else ' '.join(x)

def _info(d, spaces=DEFAULT_INDENT):
s = 'none'
if d:
items = [(('%s%s:' % (spaces, k)), v)
for k, v in sorted(six.iteritems(d))]
length = max(len(k) for k, v in items)
s = '\n'.join('%-*s %s' % (length, k, ' '.join(v)) for k, v in items)
s = '\n'.join('%-*s %s' % (length, k, _str(v)) for k, v in items)
LOGGER.info('%s\n', s)

def addresses(_):
Expand Down

0 comments on commit ed16ea8

Please sign in to comment.