# HG changeset patch # User Goffi # Date 1601539921 -7200 # Node ID 297389b1563c739f452f9d7b78993b13df3c3bfe # Parent a94cdda7d5c4aa0f9d927afa3b005c1b92d483ec jp (application/list): don't use `extend` in argument as in it Python 3.8+ only diff -r a94cdda7d5c4 -r 297389b1563c sat_frontends/jp/cmd_application.py --- a/sat_frontends/jp/cmd_application.py Mon Sep 28 21:10:33 2020 +0200 +++ b/sat_frontends/jp/cmd_application.py Thu Oct 01 10:12:01 2020 +0200 @@ -34,17 +34,26 @@ ) def add_parser_options(self): + # FIXME: "extend" would be better here, but it's only available from Python 3.8+ + # so we use "append" until minimum version of Python is raised. self.parser.add_argument( "-f", - "--filters", - action="extend", - nargs="+", + "--filter", + dest="filters", + action="append", choices=["available", "running"], - default=["available"], help=_("show applications with this status"), ) async def start(self): + + # FIXME: this is only needed because we can't use "extend" in + # add_parser_options, see note there + if self.args.filters: + self.args.filters = list(set(self.args.filters)) + else: + self.args.filters = ['available'] + try: found_apps = await self.host.bridge.applicationsList(self.args.filters) except Exception as e: