changeset 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 0883bac573fd
children c9dddf691d7b
files sat_frontends/jp/base.py
diffstat 1 files changed, 7 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/sat_frontends/jp/base.py	Sun Jun 03 18:05:01 2018 +0200
+++ b/sat_frontends/jp/base.py	Wed Jun 06 19:24:15 2018 +0200
@@ -510,8 +510,13 @@
                         try:
                             item = self.args.item
                         except AttributeError:
-                            if not self.args.items:
-                                self.args.items = [uri_item]
+                            try:
+                                items = self.args.items
+                            except AttributeError:
+                                self.disp(_(u"item specified in URL but not needed in command, ignoring it"), error=True)
+                            else:
+                                if not items:
+                                    self.args.items = [uri_item]
                         else:
                             if not item:
                                 try: