jp (info/session): by default, display started as human readable date instead of Unix time
This commit is contained in:
parent
785af76bc0
commit
c47ea6fa3b
1 changed files with 8 additions and 1 deletions
|
|
@ -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 Version(base.CommandBase):
|
|||
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
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue