From 948152ab69ec73fef92808c70176baa9171e0892 Mon Sep 17 00:00:00 2001 From: kozec Date: Tue, 27 Feb 2018 21:47:45 +0100 Subject: [PATCH] Final fixes before release. Fixes #338 --- appimage-build.sh | 14 +++++++++++--- scc/gui/app.py | 2 +- scc/gui/daemon_manager.py | 2 +- scc/lib/xinput.py | 1 + 4 files changed, 14 insertions(+), 5 deletions(-) diff --git a/appimage-build.sh b/appimage-build.sh index 1af2f4617..77c9e88b0 100644 --- a/appimage-build.sh +++ b/appimage-build.sh @@ -5,6 +5,7 @@ EXEC="scc" EVDEV_VERSION=0.7.0 [ x"$BUILD_APPDIR" == "x" ] && BUILD_APPDIR=$(pwd)/appimage + function download_dep() { NAME=$1 URL=$2 @@ -24,7 +25,7 @@ function build_dep() { pushd /tmp/${NAME} tar --extract --strip-components=1 -f /tmp/${NAME}.tar.gz python2 setup.py build - PYTHONPATH=${BUILD_APPDIR}/usr/lib/python2.7/site-packages python2 setup.py install --prefix ${BUILD_APPDIR}/usr + python2 setup.py install --prefix ${BUILD_APPDIR}/usr popd } @@ -35,7 +36,14 @@ download_dep "python-evdev-0.7.0" "https://github.com/gvalkov/python-evdev/archi download_dep "pylibacl-0.5.3" "https://github.com/iustin/pylibacl/releases/download/pylibacl-v0.5.3/pylibacl-0.5.3.tar.gz" # Prepare & build -mkdir -p ${BUILD_APPDIR}/usr/lib/python2.7/site-packages/ +export PYTHONPATH=${BUILD_APPDIR}/usr/lib/python2.7/site-packages/ +mkdir -p "$PYTHONPATH"/site-packages/ +if [[ $(grep ID_LIKE /etc/os-release) == *"suse"* ]] ; then + # Special handling for OBS + ln -s lib64 ${BUILD_APPDIR}/usr/lib + export PYTHONPATH="$PYTHONPATH":${BUILD_APPDIR}/usr/lib64/python2.7/site-packages/ +fi + build_dep "python-evdev-0.7.0" build_dep "pylibacl-0.5.3" python2 setup.py build @@ -62,4 +70,4 @@ cp scripts/${APP}.appdata.xml ${BUILD_APPDIR}/usr/share/metainfo/${APP}.appdata. cp scripts/appimage-AppRun.sh ${BUILD_APPDIR}/AppRun chmod +x ${BUILD_APPDIR}/AppRun -echo "Run appimagetool ${BUILD_APPDIR} to finish prepared appimage" +echo "Run appimagetool -n ${BUILD_APPDIR} to finish prepared appimage" diff --git a/scc/gui/app.py b/scc/gui/app.py index d5fc45ba0..3be5e607e 100644 --- a/scc/gui/app.py +++ b/scc/gui/app.py @@ -1212,7 +1212,7 @@ def mnuTurnoffController_activate(self, *a): def show_error(self, message, ribar=None): - if self.ribar is None: + if self.ribar is None or self.ribar.get_label() is None: self.ribar = ribar or RIBar(message, Gtk.MessageType.ERROR) content = self.builder.get_object("content") content.pack_start(self.ribar, False, False, 1) diff --git a/scc/gui/daemon_manager.py b/scc/gui/daemon_manager.py index 5d1c76a83..404c463dc 100644 --- a/scc/gui/daemon_manager.py +++ b/scc/gui/daemon_manager.py @@ -296,7 +296,7 @@ def start(self, mode="start"): self._on_daemon_died() Gio.Subprocess.new([ find_binary('scc-daemon'), "/dev/null", mode ], Gio.SubprocessFlags.NONE) self._connect() - GLib.timeout_add_seconds(5, self._check_connected) + GLib.timeout_add_seconds(10, self._check_connected) def restart(self): diff --git a/scc/lib/xinput.py b/scc/lib/xinput.py index 72ac62790..78ccfdf12 100644 --- a/scc/lib/xinput.py +++ b/scc/lib/xinput.py @@ -1,4 +1,5 @@ #!/usr/bin/env python2 +# -*- coding: utf-8 -*- """ XInput tools