]> git.donarmstrong.com Git - lilypond.git/commitdiff
* python/musicxml.py (Xml_node.__init__): _attribute_dict stores
authorHan-Wen Nienhuys <hanwen@xs4all.nl>
Thu, 11 May 2006 08:43:51 +0000 (08:43 +0000)
committerHan-Wen Nienhuys <hanwen@xs4all.nl>
Thu, 11 May 2006 08:43:51 +0000 (08:43 +0000)
XML attributes.
(Xml_node.message): use it.

* scripts/musicxml2ly.py (musicxml_voice_to_lily_voice):
oops. Add duration argument.

ChangeLog
VERSION
python/musicxml.py
scripts/musicxml2ly.py

index fbef4a8fd7985e122101ba188eb8b7512dc3f0c4..86d8171a57e9fc9f179cd04143bc44252ac64ef2 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,12 @@
+2006-05-11  Han-Wen Nienhuys  <hanwen@lilypond.org>
+
+       * python/musicxml.py (Xml_node.__init__): _attribute_dict stores
+       XML attributes.
+       (Xml_node.message): use it.
+
+       * scripts/musicxml2ly.py (musicxml_voice_to_lily_voice): 
+       oops. Add duration argument.
+
 2006-05-10  Joe Neeman  <joeneeman@gmail.com>
 
        * lily/paper-column-engraver.cc (make_columns):
diff --git a/VERSION b/VERSION
index ff852b3e82a871129ff109601133a1423b4f13e0..9c3e3cb61c32200c2623fb295b6ac22d921a09b9 100644 (file)
--- a/VERSION
+++ b/VERSION
@@ -1,6 +1,6 @@
 PACKAGE_NAME=LilyPond
 MAJOR_VERSION=2
 MINOR_VERSION=9
-PATCH_LEVEL=4
+PATCH_LEVEL=5
 MY_PATCH_LEVEL=
 
index 45b3523f6e0d595c8e19b853a921f046a3beaa9f..b390485c5b9c708f91535ab023d9827ed789593e 100644 (file)
@@ -8,7 +8,8 @@ class Xml_node:
        self._original = None
        self._name = 'xml_node'
        self._parent = None
-
+        self._attribute_dict = {}
+        
     def get_parent (self):
         return self._parent
     
@@ -34,8 +35,8 @@ class Xml_node:
 
         p = self
         while p:
-            print '  In: <%s %s>' % (p._name, ' '.join (['%s=%s' % item for item in p._original.attrib.items()]))
-            p = p._parent
+            print '  In: <%s %s>' % (p._name, ' '.join (['%s=%s' % item for item in p._attribute_dict.items()]))
+            p = p.get_parent ()
         
     def get_typed_children (self, klass):
        return [c for c in self._children if isinstance(c, klass)]
@@ -255,6 +256,7 @@ class Musicxml_voice:
 
 class Part (Music_xml_node):
     def __init__ (self):
+        Music_xml_node.__init__ (self)
        self._voices = []
 
     def get_part_list (self):
@@ -502,6 +504,7 @@ def lxml_demarshal_node (node):
 
     for (k,v) in node.items ():
         py_node.__dict__[k] = v
+        py_node._attribute_dict[k] = v
 
     return py_node
 
@@ -518,7 +521,8 @@ def minidom_demarshal_node (node):
     if node.attributes:
        for (nm, value) in node.attributes.items():
            py_node.__dict__[nm] = value
-
+            py_node._attribute_dict[nm] = value
+            
     py_node._data = None
     if node.nodeType == node.TEXT_NODE and node.data:
        py_node._data = node.data 
index f1125b15d6f1d7c4c4c30a8b96405c97e14513a4..c24dccb5bdb7e068b0f3ec629b7db83ab74f8109 100644 (file)
@@ -6,7 +6,6 @@ import re
 import os
 import string
 from gettext import gettext as _
-import musicxml
 
 
 
@@ -398,7 +397,7 @@ def musicxml_voice_to_lily_voice (voice):
             tuplet_events.append ((ev_chord, tuplet_event, frac))
 
     ## force trailing mm rests to be written out.   
-    voice_builder.add_music (musicexp.EventChord ())
+    voice_builder.add_music (musicexp.EventChord (), Rational (0))
     
     ly_voice = group_tuplets (voice_builder.elements, tuplet_events)