Commit 705f341e authored by Laurent Bachelier's avatar Laurent Bachelier 🐧 Committed by Vincent A

weboob command: better way to see if an application is a GUI

parent 88981904
......@@ -23,17 +23,23 @@
from __future__ import absolute_import
from __future__ import print_function
import re
import inspect
import os
import re
import sys
import inspect
from datetime import datetime, timedelta
from collections import OrderedDict
from datetime import datetime, timedelta
import weboob.applications
from weboob.tools.application.console import ConsoleApplication
try:
from weboob.tools.application.qt5 import QtApplication
except ImportError:
class QtApplication(object):
pass
__all__ = ['Weboob']
......@@ -70,11 +76,10 @@ class Weboob(ConsoleApplication):
cap = self.choose_capability(capApplicationDict)
def appsortkey(app):
appname = app.APPNAME
if appname.startswith('q') or appname.endswith('-qt'):
return '1' + appname
if issubclass(app, QtApplication):
return '1' + app.APPNAME
else:
return '0' + appname
return '0' + app.APPNAME
applications = capApplicationDict[cap]
applications = sorted(set(applications), key=appsortkey)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment