+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):
self._original = None
self._name = 'xml_node'
self._parent = None
-
+ self._attribute_dict = {}
+
def get_parent (self):
return self._parent
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)]
class Part (Music_xml_node):
def __init__ (self):
+ Music_xml_node.__init__ (self)
self._voices = []
def get_part_list (self):
for (k,v) in node.items ():
py_node.__dict__[k] = v
+ py_node._attribute_dict[k] = v
return py_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
import os
import string
from gettext import gettext as _
-import musicxml
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)