+def extract_display_text (el):
+ child = el.get_maybe_exist_named_child ("display-text")
+ if child:
+ return child.get_text ()
+ else:
+ return False
+
+
+def musicxml_print_to_lily (el):
+ # TODO: Implement other print attributes
+ # <!ELEMENT print (page-layout?, system-layout?, staff-layout*,
+ # measure-layout?, measure-numbering?, part-name-display?,
+ # part-abbreviation-display?)>
+ # <!ATTLIST print
+ # staff-spacing %tenths; #IMPLIED
+ # new-system %yes-no; #IMPLIED
+ # new-page %yes-no-number; #IMPLIED
+ # blank-page NMTOKEN #IMPLIED
+ # page-number CDATA #IMPLIED
+ # >
+ elts = []
+ if (hasattr (el, "new-system") and conversion_settings.convert_page_layout):
+ val = getattr (el, "new-system")
+ if (val == "yes"):
+ elts.append (musicexp.Break ("break"))
+ if (hasattr (el, "new-page") and conversion_settings.convert_page_layout):
+ val = getattr (el, "new-page")
+ if (val == "yes"):
+ elts.append (musicexp.Break ("pageBreak"))
+ child = el.get_maybe_exist_named_child ("part-name-display")
+ if child:
+ elts.append (musicexp.SetEvent ("Staff.instrumentName",
+ "\"%s\"" % extract_display_text (child)))
+ child = el.get_maybe_exist_named_child ("part-abbreviation-display")
+ if child:
+ elts.append (musicexp.SetEvent ("Staff.shortInstrumentName",
+ "\"%s\"" % extract_display_text (child)))
+ return elts
+
+