eric6/Tools/webBrowserSupport.py

branch
without_py2_and_pyqt4
changeset 7196
ab0a91b82b37
parent 6942
2602857055c5
child 7229
53054eb5b15a
equal deleted inserted replaced
7192:a22eee00b052 7196:ab0a91b82b37
5 # 5 #
6 6
7 """ 7 """
8 Script to determine the supported web browser variant. 8 Script to determine the supported web browser variant.
9 9
10 It looks for QtWebEngine first and the old QtWebKit thereafter. It reports the 10 It looks for QtWebEngine. It reports the variant found or the string 'None' if
11 variant found or the string 'None' if both are absent. 11 it is absent.
12 """ 12 """
13 13
14 from __future__ import unicode_literals 14 from __future__ import unicode_literals
15 15
16 import sys 16 import sys
19 19
20 try: 20 try:
21 from PyQt5 import QtWebEngineWidgets # __IGNORE_WARNING__ 21 from PyQt5 import QtWebEngineWidgets # __IGNORE_WARNING__
22 variant = "QtWebEngine" 22 variant = "QtWebEngine"
23 except ImportError: 23 except ImportError:
24 if sys.argv[-1].startswith("4."): 24 pass
25 try:
26 from PyQt4 import QtWebKit # __IGNORE_WARNING__
27 variant = "QtWebKit"
28 except ImportError:
29 pass
30 else:
31 try:
32 from PyQt5 import QtWebKit # __IGNORE_WARNING__
33 variant = "QtWebKit"
34 except ImportError:
35 pass
36 25
37 print(variant) # __IGNORE_WARNING_M801__ 26 print(variant) # __IGNORE_WARNING_M801__
38 27
39 sys.exit(0) 28 sys.exit(0)

eric ide

mercurial