From 88981904cef42befe370bab145af57458419e141 Mon Sep 17 00:00:00 2001 From: Laurent Bachelier Date: Thu, 2 Aug 2018 22:26:03 +0200 Subject: [PATCH] weboob command: Avoid duplicate entries and put GUIs at the end I'm not sure how I get duplicate entries on my system (I get them for bank), since I can't reproduce it with local_run. But this shouldn't hurt. --- scripts/weboob | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/scripts/weboob b/scripts/weboob index 2e675a0627..18c14967cb 100755 --- a/scripts/weboob +++ b/scripts/weboob @@ -69,7 +69,15 @@ class Weboob(ConsoleApplication): else: cap = self.choose_capability(capApplicationDict) + def appsortkey(app): + appname = app.APPNAME + if appname.startswith('q') or appname.endswith('-qt'): + return '1' + appname + else: + return '0' + appname + applications = capApplicationDict[cap] + applications = sorted(set(applications), key=appsortkey) application = applications[0] if len(applications) == 1 else self.choose_application(applications) application.run() -- GitLab