Mercurial > libervia-backend
comparison sat_frontends/jp/base.py @ 2910:b2f323237fce
jp, plugin merge-requests: used u'' as default for item id in pubsub arguments + fixed some required arguments:
u"" is now used as defaut item id instead of node, as it needs to be serialised anyway. This is temporary solution, as empty string can be used for item id (not forbidden by XEP-0060), but for now this is not handled correctly in jp/SàT (see https://bugs.goffi.org/bugs/view/289). Correct solution will probably need to use a special key in extra to mark empty string in id.
Added/removed some required values for node or item when it made sense.
author | Goffi <goffi@goffi.org> |
---|---|
date | Sun, 14 Apr 2019 08:21:51 +0200 |
parents | 2dfd5b1d39df |
children | ab2696e34d29 |
comparison
equal
deleted
inserted
replaced
2909:90146552cde5 | 2910:b2f323237fce |
---|---|
365 item_help = (u"item to retrieve") | 365 item_help = (u"item to retrieve") |
366 if not flags.item: | 366 if not flags.item: |
367 default = defaults.pop(u'item', _(u'last item')) | 367 default = defaults.pop(u'item', _(u'last item')) |
368 if default is not None: | 368 if default is not None: |
369 item_help += _(u" (DEFAULT: {default})".format(default=default)) | 369 item_help += _(u" (DEFAULT: {default})".format(default=default)) |
370 pubsub_group.add_argument("-i", "--item", type=unicode_decoder, help=item_help) | 370 pubsub_group.add_argument("-i", "--item", type=unicode_decoder, default=u'', |
371 help=item_help) | |
371 pubsub_group.add_argument("-L", "--last-item", action='store_true', help=_(u'retrieve last item')) | 372 pubsub_group.add_argument("-L", "--last-item", action='store_true', help=_(u'retrieve last item')) |
372 elif flags.multi_items: | 373 elif flags.multi_items: |
373 # mutiple items, this activate several features: max-items, RSM, MAM | 374 # mutiple items, this activate several features: max-items, RSM, MAM |
374 # and Orbder-by | 375 # and Orbder-by |
375 pubsub_group.add_argument("-i", "--item", type=unicode_decoder, action='append', dest='items', default=[], help=_(u"items to retrieve (DEFAULT: all)")) | 376 pubsub_group.add_argument("-i", "--item", type=unicode_decoder, action='append', dest='items', default=[], help=_(u"items to retrieve (DEFAULT: all)")) |