check for gtkwebkit 4.0 and fall back to 3.0

This commit is contained in:
j 2015-12-02 14:16:59 +01:00
parent 8d3cea2164
commit 3e13559228

11
install
View file

@ -9,6 +9,9 @@ import tarfile
from urllib.request import urlopen from urllib.request import urlopen
from threading import Thread from threading import Thread
import subprocess import subprocess
if sys.platform.startswith('linux'):
import platform
def makefolder(path): def makefolder(path):
dirname = os.path.dirname(path) dirname = os.path.dirname(path)
@ -58,12 +61,16 @@ class Install(Thread):
except: except:
apt_packages += ' python3.4 python3-pil python3-lxml' apt_packages += ' python3.4 python3-pil python3-lxml'
dnf_packages += ' python3-pillow python3-lxml' dnf_packages += ' python3-pillow python3-lxml'
version = '4.0'
distro = platform.linux_distribution()
if distro[0] == 'Ubuntu' and distro[1] <= '14.04':
version = '3.0'
try: try:
import gi import gi
gi.require_version('WebKit2', '4.0') gi.require_version('WebKit2', version)
from gi.repository import WebKit2, Gtk from gi.repository import WebKit2, Gtk
except: except:
apt_packages += ' gir1.2-webkit2-4.0' apt_packages += ' gir1.2-webkit2-' + version
dnf_packages += ' webkitgtk4' dnf_packages += ' webkitgtk4'
try: try:
import OpenSSL import OpenSSL