[pitivi] Start using the compatibility layer



commit 97e35f4d87d1b85362db9a108dcb73687590405a
Author: Thibault Saunier <thibault saunier collabora com>
Date:   Mon Jul 2 16:36:22 2012 -0400

    Start using the compatibility layer

 bin/pitivi.in      |   31 ++++++++++++-------------------
 pitivi/__init__.py |    8 --------
 2 files changed, 12 insertions(+), 27 deletions(-)
---
diff --git a/bin/pitivi.in b/bin/pitivi.in
index 7c056b0..20f5928 100644
--- a/bin/pitivi.in
+++ b/bin/pitivi.in
@@ -96,36 +96,29 @@ def _add_pitivi_path():
 def _init_gobject_gtk_gst_ges():
     global localedir
     try:
-        import pygtk
-        pygtk.require("2.0")
-
-        import gtk
-
-        import gobject
-        gobject.threads_init()
+        import pitivi.utils.pygtkcompat
+        pitivi.utils.pygtkcompat.enable()
+        pitivi.utils.pygtkcompat.enable_gtk(version='3.0')
+        from gi.repository import GdkX11
+        GdkX11 #pyflakes
     except ImportError, e:
         raise SystemExit("PyGTK couldn't be found !", str(e))
 
-    gobject.threads_init()
-
     try:
-        import pygst
-        pygst.require('0.10')
-
-        args, sys.argv[:] = sys.argv[:], sys.argv[0:1]
-        import gst
-        sys.argv = args
+        pitivi.utils.pygtkcompat.enable_gst()
     except ImportError:
         raise SystemExit("Gst-Python couldn't be found!")
 
     try:
-        import ges
+        pitivi.utils.pygtkcompat.enable_ges()
     except ImportError:
         raise SystemExit("GStreamer Editing Services couldn't be found!")
 
-    # Require GES 0.10
-    if ges.version()[1] != 10:
-        raise SystemExit("GStreamer Editing Services couldn't be found!")
+    try:
+        pitivi.utils.pygtkcompat.enable_goocanvas()
+    except ImportError:
+        raise SystemExit("GooCanvas couldn't be found!")
+
 
 def _run_pitivi():
     import pitivi.application as ptv
diff --git a/pitivi/__init__.py b/pitivi/__init__.py
index 1ce4cad..35a895c 100644
--- a/pitivi/__init__.py
+++ b/pitivi/__init__.py
@@ -1,11 +1,3 @@
 """
 Main PiTiVi package
 """
-
-import gobject
-import ges
-
-# This call must be made before any "import gst" call!
-gobject.threads_init()
-
-ges.init()



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