more linux install

This commit is contained in:
j 2016-01-17 12:14:08 +05:30
parent a76766adab
commit 9fcd9491ac
2 changed files with 11 additions and 2 deletions

View file

@ -47,6 +47,13 @@ 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'
try:
import gi
gi.require_version('Gtk', '3.0')
from gi.repository import Gtk, GLib
except:
apt_packages += ' gir1.2-gtk-3.0'
#dnf_packages += ' webkitgtk4'
try: try:
import OpenSSL import OpenSSL
from OpenSSL.SSL import TLSv1_2_METHOD from OpenSSL.SSL import TLSv1_2_METHOD
@ -114,7 +121,7 @@ class Install(Thread):
def download(self, url, filename): def download(self, url, filename):
makefolder(filename) makefolder(filename)
print(os.path.basename(filename)) print('downloading',os.path.basename(filename))
with open(filename, 'wb') as f: with open(filename, 'wb') as f:
with closing(urlopen(url)) as u: with closing(urlopen(url)) as u:
size = int(u.headers.get('content-length', 0)) size = int(u.headers.get('content-length', 0))

View file

@ -2,7 +2,8 @@ import os
import sys import sys
import settings import settings
from utils import run, makefolder import ox
from utils import run
root_dir = os.path.dirname(settings.base_dir) root_dir = os.path.dirname(settings.base_dir)
@ -58,6 +59,7 @@ def install_launchd():
def install_xdg(): def install_xdg():
app = os.path.expanduser('~/.local/share/applications/openmedialibrary.desktop') app = os.path.expanduser('~/.local/share/applications/openmedialibrary.desktop')
ox.makedirs(os.path.dirname(app))
with open(app, 'w') as fd: with open(app, 'w') as fd:
fd.write('''[Desktop Entry] fd.write('''[Desktop Entry]
Type=Application Type=Application