diff 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
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: