]> git.donarmstrong.com Git - lilypond.git/commitdiff
fixed issue 1109: makelsr.py now strips right-hand whitespace
authorFrederic Bron <frederic.bron@m4x.org>
Fri, 11 Jun 2010 12:14:52 +0000 (14:14 +0200)
committerGraham Percival <graham@percival-music.ca>
Fri, 11 Jun 2010 13:01:19 +0000 (14:01 +0100)
scripts/auxiliar/makelsr.py

index ca7db5c5b2ca900fe047e6fc21bd91433bbcfa05..1076f22ded67309bc54be1730a03b7c25790dca2 100755 (executable)
@@ -83,6 +83,7 @@ def mark_verbatim_section (ly_code):
 lsr_comment_re = re.compile (r'\s*%+\s*LSR.*')
 begin_header_re = re.compile (r'\\header\s*{', re.M)
 ly_new_version_re = re.compile (r'\\version\s*"(.+?)"')
+strip_white_spaces_re = re.compile (r'[ \t]+(?=\n)')
 
 # add tags to ly files from LSR
 def add_tags (ly_code, tags):
@@ -136,6 +137,7 @@ def copy_ly (srcdir, name, tags):
 
     s = mark_verbatim_section (s)
     s = lsr_comment_re.sub ('', s)
+    s = strip_white_spaces_re.sub ('', s)
     open (dest, 'w').write (s)
 
     e = os.system ("convert-ly -e '%s'" % dest)