use dnf on fedora, install webkit2 if needed

This commit is contained in:
j 2015-11-04 12:37:56 +01:00
parent 3119f2b5a9
commit c717a135af

19
install
View file

@ -51,26 +51,33 @@ class Install(Thread):
self.status['installing'] = 'setup'
if sys.platform.startswith('linux'):
apt_packages = ''
yum_packages = ''
dnf_packages = ''
try:
import Image
import simplejson
import lxml
except:
apt_packages += ' python3.4 python3-pil python-simplejson python3-lxml'
yum_packages += ' python3-pil python3-simplejson python3-lxml'
dnf_packages += ' python3-pillow python3-simplejson python3-lxml'
try:
import gi
gi.require_version('WebKit2', '4.0')
from gi.repository import WebKit2, Gtk
except:
apt_packages += ' gir1.2-webkit2-4.0'
dnf_packages += ' webkitgtk4'
if not has_bin('pdftocairo'):
apt_packages += ' poppler-utils'
yum_packages += ' poppler-utils'
dnf_packages += ' poppler-utils'
if not os.path.exists('/usr/sbin/miredo'):
apt_packages += ' miredo'
if has_bin('apt-get') and apt_packages:
print('Installing additional packages: %s' % apt_packages)
os.system('sudo apt-get install -y ' + apt_packages)
elif has_bin('yum') and yum_packages:
print('Installing additional packages: %s' % yum_packages)
os.system('sudo yum install ' + yum_packages)
elif has_bin('dnf') and dnf_packages:
print('Installing additional packages: %s' % dnf_packages)
os.system('sudo dnf install ' + dnf_packages)
else:
print('You need to install Pillow, simplejson and lxml\ni.e. sudo pip3 install pillow simplejson lxml')
if 'poppler' in apt_packages: