[gst-cvs] common: mangle-tmpl.py: don't fail if there's no description for an element

Tim Mueller tpm at kemper.freedesktop.org
Sat Aug 29 16:16:43 PDT 2009


Module: common
Branch: master
Commit: 00a859ed129d5b8c023ffa5704c7effa091a6d89
URL:    http://cgit.freedesktop.org/gstreamer/common/commit/?id=00a859ed129d5b8c023ffa5704c7effa091a6d89

Author: Tim-Philipp Müller <tim.muller at collabora.co.uk>
Date:   Sun Aug 30 00:15:13 2009 +0100

mangle-tmpl.py: don't fail if there's no description for an element

---

 mangle-tmpl.py |    5 ++++-
 1 files changed, 4 insertions(+), 1 deletions(-)

diff --git a/mangle-tmpl.py b/mangle-tmpl.py
index e4095a2..76ca1f5 100644
--- a/mangle-tmpl.py
+++ b/mangle-tmpl.py
@@ -116,7 +116,10 @@ def get_elements(file):
                 if e2.nodeType == e2.ELEMENT_NODE and e2.localName == 'name':
                     name = e2.childNodes[0].nodeValue.encode("UTF-8")
                 elif e2.nodeType == e2.ELEMENT_NODE and e2.localName == 'description':
-                    description = e2.childNodes[0].nodeValue.encode("UTF-8")
+                    if e2.childNodes:
+                      description = e2.childNodes[0].nodeValue.encode("UTF-8")
+                    else:
+                      description = 'No description'
 
             if name != None and description != None:
                 elements[name] = {'description': description}





More information about the Gstreamer-commits mailing list