diff options
-rw-r--r-- | src/leap/bitmask/cli/mail.py | 21 |
1 files changed, 15 insertions, 6 deletions
diff --git a/src/leap/bitmask/cli/mail.py b/src/leap/bitmask/cli/mail.py index 73e2196..7fd574b 100644 --- a/src/leap/bitmask/cli/mail.py +++ b/src/leap/bitmask/cli/mail.py @@ -56,10 +56,19 @@ SUBCOMMANDS: return self._send(self._print_status) def _print_status(self, status, depth=0): - spaces = depth * " " + for name, v in [('mail', status)] + status['childrenStatus'].items(): + line = Fore.RESET + name.ljust(10) + if v['status'] in ('on', 'starting'): + line += Fore.GREEN + elif v['status'] == 'failure': + line += Fore.RED + line += v['status'] + if v['error']: + line += Fore.RED + " (" + v['error'] + ")" + line += Fore.RESET + print(line) + for k, v in status.items(): - if type(v) == dict: - print(spaces + k + ":") - self._print_status(v, depth + 1) - else: - print(spaces + k + ": " + Fore.GREEN + str(v) + Fore.RESET) + if k in ('status', 'childrenStatus', 'error'): + continue + print(Fore.RESET + k.ljust(10) + Fore.CYAN + str(v) + Fore.RESET) |