]> git.donarmstrong.com Git - lilypond.git/blobdiff - python/musicxml.py
Merge branch 'master' of ssh+git://hanwen@git.sv.gnu.org/srv/git/lilypond
[lilypond.git] / python / musicxml.py
index a6b8c2ab4133c0d09e1299ae0a0c1032c405ce33..e9d1ef8bedebd195450a78660f3ff716379dbc5e 100644 (file)
@@ -51,7 +51,7 @@ class Xml_node:
        return ''.join ([c.get_text () for c in self._children])
 
     def message (self, msg):
-        sys.stderr.write (msg+'\n')
+        lilylib.stderr_write (msg+'\n')
 
         p = self
         while p:
@@ -179,6 +179,16 @@ class Identification (Xml_node):
         return self.get_encoding_information ('encoder')
     def get_encoding_description (self):
         return self.get_encoding_information ('encoding-description')
+    
+    def get_encoding_software_list (self):
+        enc = self.get_named_children ('encoding')
+        software = []
+        for e in enc:
+            softwares = e.get_named_children ('software')
+            for s in softwares:
+                software.append (s.get_text ())
+        return software
+
 
 
 class Duration (Music_xml_node):
@@ -943,7 +953,9 @@ def get_class (name):
 def lxml_demarshal_node (node):
     name = node.tag
 
-    if name is None:
+    # TODO: This is a nasty hack, but I couldn't find any other way to check
+    #       if the given node is a comment node (class _Comment):
+    if name is None or re.match (u"^<!--.*-->$", node.__repr__()):
         return None
     klass = get_class (name)
     py_node = klass()