comparison sat_frontends/jp/cmd_file.py @ 2592:c0401a72cbb4

jp (file/share/list): fixed default value for jid
author Goffi <goffi@goffi.org>
date Fri, 25 May 2018 10:52:01 +0200
parents 26edcf3a30eb
children 56f94936df1e
comparison
equal deleted inserted replaced
2591:86e57108bd50 2592:c0401a72cbb4
378 super(ShareList, self).__init__(host, 'list', use_output=C.OUTPUT_LIST_DICT, extra_outputs=extra_outputs, help=_(u'retrieve files shared by an entity'), use_verbose=True) 378 super(ShareList, self).__init__(host, 'list', use_output=C.OUTPUT_LIST_DICT, extra_outputs=extra_outputs, help=_(u'retrieve files shared by an entity'), use_verbose=True)
379 self.need_loop=True 379 self.need_loop=True
380 380
381 def add_parser_options(self): 381 def add_parser_options(self):
382 self.parser.add_argument("-d", "--path", default=u'', help=_(u"path to the directory containing the files")) 382 self.parser.add_argument("-d", "--path", default=u'', help=_(u"path to the directory containing the files"))
383 self.parser.add_argument("jid", type=base.unicode_decoder, nargs='?', help=_("jid of sharing entity (nothing to check our own jid)")) 383 self.parser.add_argument("jid", type=base.unicode_decoder, nargs='?', default='', help=_("jid of sharing entity (nothing to check our own jid)"))
384 384
385 def file_gen(self, files_data): 385 def file_gen(self, files_data):
386 for file_data in files_data: 386 for file_data in files_data:
387 yield file_data[u'name'] 387 yield file_data[u'name']
388 yield file_data.get(u'size', '') 388 yield file_data.get(u'size', '')