]> git.donarmstrong.com Git - lilypond.git/commitdiff
Customize LSR snippets headers
authorJohn Mandereau <john.mandereau@gmail.com>
Sat, 5 Jan 2008 00:02:48 +0000 (01:02 +0100)
committerJohn Mandereau <john.mandereau@gmail.com>
Sat, 5 Jan 2008 00:02:48 +0000 (01:02 +0100)
buildscripts/makelsr.py

index 480da8cc7517ca70af4f90fa647adeb256243bfc..61317729cb0ff16d4d0caa1889fcef91ddd6e350 100755 (executable)
@@ -10,7 +10,12 @@ This script must be run from top of the source tree;
 it updates snippets input/lsr with snippets in input/new or LSR_SNIPPETS_DIR.
 '''
 
-LY_HEADER = '''%%%% Do not edit this file; it is auto-generated from LSR!
+LY_HEADER_LSR = '''%%%% Do not edit this file; it is auto-generated from LSR http://lsr.dsi.unimi.it
+%%%% This file is in the public domain.
+%%%% Tags: %s
+'''
+
+LY_HEADER_NEW = '''%%%% Do not edit this file; it is auto-generated from input/new
 %%%% Tags: %s
 '''
 
@@ -20,14 +25,15 @@ NEW_LYS = os.path.join ('input', 'new')
 TAGS = []
 # NR 1
 TAGS.extend (['pitches', 'rhythms', 'expressive-marks',
-'repeats', 'simultaneous-notes', 'staff-notation', 'editorial-and-educational-use', 'text'])
+'repeats', 'simultaneous-notes', 'staff-notation',
+'editorial-and-educational-use', 'text'])
 # NR 2
 TAGS.extend (['vocal-music', 'chords', 'piano-music',
 'percussion', 'guitar', 'strings', 'bagpipes', 'ancient-notation'])
 
 # other
-TAGS.extend (['contexts-and-engravers', 'tweaks-and-overrides', 'paper-and-layout', 'breaks',
-'spacing', 'midi', 'titles', 'template', 'other'])
+TAGS.extend (['contexts-and-engravers', 'tweaks-and-overrides',
+'paper-and-layout', 'breaks', 'spacing', 'midi', 'titles', 'template', 'other'])
 
 def exit_with_usage (n=0):
        sys.stderr.write (USAGE)
@@ -55,7 +61,11 @@ def copy_ly (srcdir, name, tags):
        global unconverted
        dest = os.path.join (DEST, name)
        f = open (dest, 'w')
-       f.write (LY_HEADER % ', '.join (tags))
+       if in_dir in srcdir:
+               h = LY_HEADER_LSR
+       else:
+               h = LY_HEADER_NEW
+       f.write (h % ', '.join (tags))
        f.write (mark_verbatim_section (open (os.path.join (srcdir, name)).read ()))
        f.close ()
        e = os.system('convert-ly -e ' + dest)