[pitivi] check: Present a human-readable error when gst-python is not working properly
- From: Jean-François Fortin Tam <jfft src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [pitivi] check: Present a human-readable error when gst-python is not working properly
- Date: Mon, 3 Nov 2014 01:31:26 +0000 (UTC)
commit d1ea9a9712cad86abece03963bde9bea4564bbda
Author: Jean-François Fortin Tam <nekohayo gmail com>
Date: Sat Nov 1 22:17:48 2014 -0400
check: Present a human-readable error when gst-python is not working properly
This is 1000x better than the cryptic traceback users get when pygst is missing
pitivi/check.py | 15 ++++++++++++++-
1 files changed, 14 insertions(+), 1 deletions(-)
---
diff --git a/pitivi/check.py b/pitivi/check.py
index e70446b..c2a82fb 100644
--- a/pitivi/check.py
+++ b/pitivi/check.py
@@ -212,7 +212,6 @@ SOFT_DEPENDENCIES = (PYCANBERRA_SOFT_DEPENDENCY,
def _check_audiosinks():
from gi.repository import Gst
-
# Yes, this can still fail, if PulseAudio is non-responsive for example.
sink = Gst.ElementFactory.make("autoaudiosink", None)
if not sink:
@@ -220,6 +219,15 @@ def _check_audiosinks():
return True
+def _check_gst_python():
+ from gi.repository import Gst
+ try:
+ Gst.Fraction(9001, 1) # It's over NINE THOUSANDS!
+ except TypeError:
+ return False # What, nine thousands?! There's no way that can be right
+ return True
+
+
def check_requirements():
hard_dependencies_satisfied = True
for dependency in HARD_DEPENDENCIES:
@@ -241,6 +249,11 @@ def check_requirements():
if not hard_dependencies_satisfied:
return False
+ if not _check_gst_python():
+ print((_("ERROR — Could not create a Gst.Fraction — "
+ "this means gst-python is not installed correctly.")))
+ return False
+
if not _check_audiosinks():
print((_("Could not create audio output sink. "
"Make sure you have a valid one (pulsesink, alsasink or osssink).")))
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]