[pitivi: 16/94] Report the value which caused a TypeError in ElementTreeFormatter._parsePropertyValue



commit 63eacd751b10d93f3b6e377cbe418664677bda02
Author: Alex BÄluÈ <alexandru balut gmail com>
Date:   Thu Jul 7 11:52:42 2011 +0200

    Report the value which caused a TypeError in ElementTreeFormatter._parsePropertyValue

 pitivi/formatters/etree.py |    8 ++++++--
 1 files changed, 6 insertions(+), 2 deletions(-)
---
diff --git a/pitivi/formatters/etree.py b/pitivi/formatters/etree.py
index f20530b..a70ad71 100644
--- a/pitivi/formatters/etree.py
+++ b/pitivi/formatters/etree.py
@@ -116,8 +116,12 @@ class ElementTreeFormatter(Formatter):
         # and gst.Caps() fails to parse it, because it has "L" at the end.
         if "(guint64)" in value:
             value = value.rstrip('lL')
-        # TODO: Use what gst.Caps() uses to parse a property value.
-        caps = gst.Caps("structure1, property1=%s;" % value)
+        try:
+            # TODO: Use what gst.Caps() uses to parse a property value.
+            caps = gst.Caps("structure1, property1=%s;" % value)
+        except TypeError, exception:
+            # Report the value which caused the exception.
+            raise Exception(exception, value)
         structure = caps[0]
         return structure["property1"]
 



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