[gnome-control-center/wip/hadess/fix-power-scenario-test] power: Fix launching upower from scenario tester
- From: Bastien Nocera <hadess src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-control-center/wip/hadess/fix-power-scenario-test] power: Fix launching upower from scenario tester
- Date: Wed, 26 Jan 2022 12:03:59 +0000 (UTC)
commit e1b3b05e90466bdcb2293192ddabab8cf32157a4
Author: Bastien Nocera <hadess hadess net>
Date: Wed Jan 26 12:59:39 2022 +0100
power: Fix launching upower from scenario tester
Not everyone would have upower built under jhbuild, so use the system
one if we can't find it.
panels/power/power-panel-scenario-tester.py | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)
---
diff --git a/panels/power/power-panel-scenario-tester.py b/panels/power/power-panel-scenario-tester.py
index af0fa3721..6c8a0f18d 100755
--- a/panels/power/power-panel-scenario-tester.py
+++ b/panels/power/power-panel-scenario-tester.py
@@ -57,7 +57,10 @@ class GccDBusTestCase(DBusTestCase):
if os.environ.get('UNDER_JHBUILD', False):
jhbuild_prefix = os.environ['JHBUILD_PREFIX']
klass.upowerd_path = os.path.join(jhbuild_prefix, 'libexec', 'upowerd')
- else:
+ if not GLib.file_test(klass.upowerd_path, GLib.FileTest.IS_EXECUTABLE):
+ klass.upowerd_path = None
+
+ if os.environ.get('UNDER_JHBUILD', False) or klass.upowerd_path == None:
klass.upowerd_path = None
with open('/usr/share/dbus-1/system-services/org.freedesktop.UPower.service') as f:
for line in f:
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]