From 3e13559228129b7d8ef98b6f4878ca95bf18709b Mon Sep 17 00:00:00 2001 From: j Date: Wed, 2 Dec 2015 14:16:59 +0100 Subject: [PATCH] check for gtkwebkit 4.0 and fall back to 3.0 --- install | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/install b/install index 5223c71..6ed30ae 100755 --- a/install +++ b/install @@ -9,6 +9,9 @@ import tarfile from urllib.request import urlopen from threading import Thread import subprocess +if sys.platform.startswith('linux'): + import platform + def makefolder(path): dirname = os.path.dirname(path) @@ -58,12 +61,16 @@ class Install(Thread): except: apt_packages += ' python3.4 python3-pil 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: import gi - gi.require_version('WebKit2', '4.0') + gi.require_version('WebKit2', version) from gi.repository import WebKit2, Gtk except: - apt_packages += ' gir1.2-webkit2-4.0' + apt_packages += ' gir1.2-webkit2-' + version dnf_packages += ' webkitgtk4' try: import OpenSSL