[meld] meld: Add an import check for GtkSourceView



commit dfb8ae16eb942e6138f6902ee5dab36b7efef674
Author: Kai Willadsen <kai willadsen gmail com>
Date:   Thu Nov 7 05:24:53 2013 +1000

    meld: Add an import check for GtkSourceView

 bin/meld |    7 +++++++
 1 files changed, 7 insertions(+), 0 deletions(-)
---
diff --git a/bin/meld b/bin/meld
index 70f30be..6fea672 100755
--- a/bin/meld
+++ b/bin/meld
@@ -107,6 +107,7 @@ def check_requirements():
     pyver = (2, 7)
     gtk_requirement = (3, 6)
     glib_requirement = (2, 34, 0)
+    gtksourceview_requirement = (3, 6, 0)
 
     def missing_reqs(mod, ver, exception=None):
         if isinstance(exception, ImportError):
@@ -136,6 +137,12 @@ def check_requirements():
     except (ImportError, AssertionError) as e:
         missing_reqs("GLib", glib_requirement, e)
 
+    try:
+        from gi.repository import GtkSource
+        # TODO: There is no way to get at GtkSourceView's actual version
+    except (ImportError, AssertionError) as e:
+        missing_reqs("GtkSourceView", gtksourceview_requirement, e)
+
 
 def setup_resources():
     from gi.repository import GObject


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