From 9514ac64189eb5278ae5fde56ad2e7e8198e2222 Mon Sep 17 00:00:00 2001 From: "Florian \"sp1rit" <31540351+sp1ritCS@users.noreply.github.com> Date: Mon, 14 Nov 2022 10:45:39 +0000 Subject: [PATCH] Added suggestions from @whot Co-authored-by: Peter Hutterer --- tuhi-gui.in | 6 ++++-- tuhi.in | 8 ++------ 2 files changed, 6 insertions(+), 8 deletions(-) diff --git a/tuhi-gui.in b/tuhi-gui.in index ab1fdcb..46d6e96 100755 --- a/tuhi-gui.in +++ b/tuhi-gui.in @@ -18,9 +18,11 @@ from gi.repository import Gio @devel@ # NOQA if "TUHI_DEVEL" in os.environ: - resource = Gio.resource_load(os.fspath(Path(os.environ["TUHI_DEVEL"], 'data', 'tuhi.gresource'))) + resource_path = Path(os.environ["TUHI_DEVEL"], 'data', 'tuhi.gresource') else: - resource = Gio.resource_load(os.fspath(Path('@pkgdatadir@', 'tuhi.gresource'))) + resource_path = Path('@pkgdatadir@', 'tuhi.gresource') + +resource = Gio.resource_load(os.fspath(resource_path)) Gio.Resource._register(resource) diff --git a/tuhi.in b/tuhi.in index c6c17f2..77e8bc7 100755 --- a/tuhi.in +++ b/tuhi.in @@ -17,12 +17,8 @@ import subprocess from pathlib import Path import argparse -if "TUHI_DEVEL" in os.environ: - tuhi_server = Path(os.environ["TUHI_DEVEL"], 'tuhi-server') - tuhi_gui = Path(os.environ["TUHI_DEVEL"], 'tuhi-gui') -else: - tuhi_server = Path('@libexecdir@', 'tuhi-server') - tuhi_gui = Path('@libexecdir@', 'tuhi-gui') +tuhi_server = Path(os.environ.get("TUHI_DEVEL", "@libexecdir@"), 'tuhi-server') +tuhi_gui = Path(os.environ.get("TUHI_DEVEL", "@libexecdir@"), 'tuhi-gui') @devel@ # NOQA