-FRAGMENT_LY = r'''
-%(notes_string)s
-{
-
-
-%% ****************************************************************
-%% ly snippet contents follows:
-%% ****************************************************************
-%(code)s
-
-
-%% ****************************************************************
-%% end ly snippet
-%% ****************************************************************
-}
-'''
-
def classic_lilypond_book_compatibility (key, value):
if key == 'singleline' and value == None:
return (RAGGED_RIGHT, None)
%% ****************************************************************
'''
+FRAGMENT_LY = r'''
+%(notes_string)s
+{
+%% ****************************************************************
+%% ly snippet contents follows:
+%% ****************************************************************
+%(code)s
+
+%% ****************************************************************
+%% end ly snippet
+%% ****************************************************************
+}
+'''
return self.option_list
def compose_ly (self, code):
- if FRAGMENT in self.option_dict:
- body = FRAGMENT_LY
- else:
- body = FULL_LY
# Defaults.
relative = 1
d = globals().copy()
d.update (locals())
d.update (self.global_options.information)
+ if FRAGMENT in self.option_dict:
+ body = FRAGMENT_LY
+ else:
+ body = FULL_LY
return (PREAMBLE_LY + body) % d
def get_checksum (self):
def convert_from_musicxml (self):
name = self.filename
- option_list = []
+ xml2ly_option_list = []
for (key, value) in self.option_dict.items ():
cmd_key = self.musicxml_options_dict.get (key, None)
if cmd_key == None:
continue
if value == None:
- option_list.append (cmd_key)
+ xml2ly_option_list.append (cmd_key)
else:
- option_list.append (cmd_key + '=' + value)
- if ('.mxl' in name) and ('--compressed' not in option_list):
- option_list.append ('--compressed')
+ xml2ly_option_list.append (cmd_key + '=' + value)
+ if ('.mxl' in name) and ('--compressed' not in xml2ly_option_list):
+ xml2ly_option_list.append ('--compressed')
self.compressed = True
- opts = " ".join (option_list)
+ opts = " ".join (xml2ly_option_list)
progress (_ ("Converting MusicXML file `%s'...\n") % self.filename)
ly_code = self.filter_pipe (self.contents, 'musicxml2ly %s --out=- - ' % opts)