comparison sat_frontends/jp/cmd_info.py @ 2605:87f8cf51fca5

jp (info/session): show short + relative date by default for "started"
author Goffi <goffi@goffi.org>
date Fri, 01 Jun 2018 18:27:49 +0200
parents 947c4c4c5c53
children 263a00e90174
comparison
equal deleted inserted replaced
2604:700327fa9281 2605:87f8cf51fca5
173 super(Session, self).__init__(host, 'session', use_output='dict', extra_outputs=extra_outputs, help=_('running session')) 173 super(Session, self).__init__(host, 'session', use_output='dict', extra_outputs=extra_outputs, help=_('running session'))
174 self.need_loop=True 174 self.need_loop=True
175 175
176 def default_output(self, data): 176 def default_output(self, data):
177 started = data['started'] 177 started = data['started']
178 data['started'] = date_utils.date_fmt(started) 178 data['started'] = u'{short} (UTC, {relative})'.format(
179 short=date_utils.date_fmt(started),
180 relative=date_utils.date_fmt(started, 'relative'))
179 self.host.output(C.OUTPUT_DICT, 'simple', {}, data) 181 self.host.output(C.OUTPUT_DICT, 'simple', {}, data)
180 182
181 def add_parser_options(self): 183 def add_parser_options(self):
182 pass 184 pass
183 185