[pitivi] Keep compatibility with Gst 1.10 trying to check presence of gstgtk



commit 5cfb296ce9fe94e116a447a318e011f886fdc8d2
Author: Thibault Saunier <tsaunier gnome org>
Date:   Sat Mar 11 13:46:00 2017 -0300

    Keep compatibility with Gst 1.10 trying to check presence of gstgtk

 pitivi/check.py |   15 ++++++++++++++-
 1 files changed, 14 insertions(+), 1 deletions(-)
---
diff --git a/pitivi/check.py b/pitivi/check.py
index f300525..4e5a00e 100644
--- a/pitivi/check.py
+++ b/pitivi/check.py
@@ -152,6 +152,10 @@ class ClassicDependency(Dependency):
 
 class GstPluginDependency(Dependency):
 
+    def __init__(self, *args, **kwargs):
+        self.__extra_modulenames = kwargs.pop("extra_modulenames", [])
+        super().__init__(*args, **kwargs)
+
     def _try_importing_component(self):
         try:
             from gi.repository import Gst
@@ -161,6 +165,12 @@ class GstPluginDependency(Dependency):
 
         registry = Gst.Registry.get()
         plugin = registry.find_plugin(self.modulename)
+        if not plugin and self.__extra_modulenames:
+            for module in self.__extra_modulenames:
+                plugin = registry.find_plugin(module)
+                if plugin:
+                    return plugin
+
         return plugin
 
     def _format_version(self, plugin):
@@ -371,7 +381,10 @@ HARD_DEPENDENCIES = [GICheck("3.20.0"),
                      GtkDependency("Gtk", GTK_API_VERSION, "3.20.0"),
                      ClassicDependency("numpy"),
                      GIDependency("Gio", "2.0"),
-                     GstPluginDependency("gtk", "1.10.2"),
+                     # TODO Remove extra_modules when we depend
+                     # on Gst 1.12
+                     GstPluginDependency("gtk", "1.10.2",
+                                         extra_modulenames=["gstgtk"]),
                      GstPluginDependency("gdkpixbuf", "1.10.2"),
                      ClassicDependency("matplotlib"),
                      ]


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]