]> git.donarmstrong.com Git - lilypond.git/commitdiff
Lilypond-book: Move code around, no real changes
authorReinhold Kainhofer <reinhold@kainhofer.com>
Sun, 21 Aug 2011 14:35:01 +0000 (16:35 +0200)
committerReinhold Kainhofer <reinhold@kainhofer.com>
Mon, 22 Aug 2011 10:42:40 +0000 (12:42 +0200)
python/book_snippets.py

index a7f99f875f873ed349f300bde6d17bb724b1cc7a..f5ce34d3b909e23505d630f9641ebd501f31e654 100644 (file)
@@ -143,23 +143,6 @@ snippet_options = {
 
 
 
-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)
@@ -219,9 +202,22 @@ FULL_LY = '''
 %% ****************************************************************
 '''
 
+FRAGMENT_LY = r'''
+%(notes_string)s
+{
+
 
+%% ****************************************************************
+%% ly snippet contents follows:
+%% ****************************************************************
+%(code)s
 
 
+%% ****************************************************************
+%% end ly snippet
+%% ****************************************************************
+}
+'''
 
 
 
@@ -457,10 +453,6 @@ left-margin-default right-margin-default)"
         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
@@ -571,6 +563,10 @@ left-margin-default right-margin-default)"
         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):