Mercurial > libervia-backend
comparison sat_frontends/jp/base.py @ 2609:75d2ac872965
jp (base): do not crash when item is specified (e.g. in URL) but not needed in command, but display a message on stderr.
author | Goffi <goffi@goffi.org> |
---|---|
date | Wed, 06 Jun 2018 19:24:15 +0200 |
parents | 4011e4ee3151 |
children | a5b96950b81a |
comparison
equal
deleted
inserted
replaced
2608:0883bac573fd | 2609:75d2ac872965 |
---|---|
508 # we use it only if item is not already set | 508 # we use it only if item is not already set |
509 # and item_last is not used either | 509 # and item_last is not used either |
510 try: | 510 try: |
511 item = self.args.item | 511 item = self.args.item |
512 except AttributeError: | 512 except AttributeError: |
513 if not self.args.items: | 513 try: |
514 self.args.items = [uri_item] | 514 items = self.args.items |
515 except AttributeError: | |
516 self.disp(_(u"item specified in URL but not needed in command, ignoring it"), error=True) | |
517 else: | |
518 if not items: | |
519 self.args.items = [uri_item] | |
515 else: | 520 else: |
516 if not item: | 521 if not item: |
517 try: | 522 try: |
518 item_last = self.args.item_last | 523 item_last = self.args.item_last |
519 except AttributeError: | 524 except AttributeError: |