# HG changeset patch # User Goffi # Date 1527847593 -7200 # Node ID 947c4c4c5c5306a09872b7fd6d92c9e3efbbb0b9 # Parent 5b26033c49a86eb83a2f5d3fb012a155f7525aa3 jp (info/session): by default, display started as human readable date instead of Unix time diff -r 5b26033c49a8 -r 947c4c4c5c53 sat_frontends/jp/cmd_info.py --- a/sat_frontends/jp/cmd_info.py Fri Jun 01 12:04:06 2018 +0200 +++ b/sat_frontends/jp/cmd_info.py Fri Jun 01 12:06:33 2018 +0200 @@ -20,6 +20,7 @@ import base from sat.core.i18n import _ from sat.tools.common.ansi import ANSI as A +from sat.tools.common import date_utils from sat_frontends.jp.constants import Const as C from sat_frontends.jp import common @@ -168,9 +169,15 @@ class Session(base.CommandBase): def __init__(self, host): - super(Session, self).__init__(host, 'session', use_output='dict', help=_('running session')) + extra_outputs = {'default': self.default_output} + super(Session, self).__init__(host, 'session', use_output='dict', extra_outputs=extra_outputs, help=_('running session')) self.need_loop=True + def default_output(self, data): + started = data['started'] + data['started'] = date_utils.date_fmt(started) + self.host.output(C.OUTPUT_DICT, 'simple', {}, data) + def add_parser_options(self): pass