[pitivi] formatters/etree.py : Make GEnum loading working



commit d605c7b841b23eae28af4656cbc6d8e32dfddd07
Author: Thibault Saunier <tsaunier gnome org>
Date:   Sat Jul 31 21:07:22 2010 +0200

    formatters/etree.py : Make GEnum loading working

 pitivi/formatters/etree.py |    7 ++++++-
 1 files changed, 6 insertions(+), 1 deletions(-)
---
diff --git a/pitivi/formatters/etree.py b/pitivi/formatters/etree.py
index 0756584..f9fbbf5 100644
--- a/pitivi/formatters/etree.py
+++ b/pitivi/formatters/etree.py
@@ -94,6 +94,10 @@ class ElementTreeFormatter(Formatter):
     def _parsePropertyValue(self, value):
         # nothing to read here, move along
         # edward: argh, I went past there, what shall I do now ?
+
+        #FIXME
+        if "(GEnum)" in value:
+            return int(value.split("(GEnum)")[1])
         return gst.Caps("meh, name=%s" % value)[0]["name"]
 
     def _saveStream(self, stream):
@@ -355,8 +359,9 @@ class ElementTreeFormatter(Formatter):
         properties = gobject.list_properties(effect)
         for prop in properties:
             type_name = str(gobject.type_name(prop.value_type.fundamental))
+            #FIXME we just take the int equivalent to the GEnum, how should it be handled?
             if type_name == "GEnum":
-                value = str(effect.get_property(prop.name).value_name)
+                value = str(effect.get_property(prop.name).__int__())
             else:
                 value = str(effect.get_property(prop.name))
             effect_properties.attrib[prop.name] = '(' + type_name + ')' + value



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