[pitivi/gtktimeline: 12/28] validate: Add a way to inspect action	types from pitivi
- From: Thibault Saunier <tsaunier src gnome org>
- To: commits-list gnome org
- Cc: 
- Subject: [pitivi/gtktimeline: 12/28] validate: Add a way to inspect action	types from pitivi
- Date: Tue,  5 May 2015 07:50:57 +0000 (UTC)
commit b753ae362e929cf88072520b763b7a4a34205500
Author: Thibault Saunier <tsaunier gnome org>
Date:   Sat Apr 18 11:53:36 2015 +0200
    validate: Add a way to inspect action types from pitivi
    
    We can not use GOption from the introspection so bypass the command
    line management interface of GApplication and get it done.
 pitivi/check.py          |   10 +++++++++-
 pitivi/utils/validate.py |    4 ++--
 2 files changed, 11 insertions(+), 3 deletions(-)
---
diff --git a/pitivi/check.py b/pitivi/check.py
index 0a29639..203de5b 100644
--- a/pitivi/check.py
+++ b/pitivi/check.py
@@ -260,7 +260,15 @@ def initialize_modules():
     res, sys.argv = GES.init_check(sys.argv)
 
     from pitivi.utils import validate
-    validate.init()
+    if validate.init() and "--inspect-action-type" in sys.argv:
+        try:
+            action_type = [sys.argv[1 + sys.argv.index("--inspect-action-type")]]
+        except IndexError:
+            action_type = []
+        if validate.GstValidate.print_action_types(action_type):
+            exit(0)
+        else:
+            exit(1)
 
 
 """
diff --git a/pitivi/utils/validate.py b/pitivi/utils/validate.py
index b69657a..b6ae0c5 100644
--- a/pitivi/utils/validate.py
+++ b/pitivi/utils/validate.py
@@ -492,7 +492,6 @@ def init():
                                          remove_clip, None,
                                          "Remove clip",
                                          GstValidate.ActionTypeFlags.NONE)
-
         GstValidate.register_action_type("select-clips", "pitivi",
                                          select_clips, [Parametter("clip-name",
                                                                    "The name of the clip to select",
@@ -513,6 +512,7 @@ def init():
                                    "All sink should display their images in an embedded "
                                    "widget and thus not create a new window",
                                    GstValidate.ReportLevel.CRITICAL))
-
+        return True
     except ImportError:
         has_validate = False
+        return False
[
Date Prev][
Date Next]   [
Thread Prev][
Thread Next]   
[
Thread Index]
[
Date Index]
[
Author Index]