]> git.donarmstrong.com Git - lilypond.git/commitdiff
(parse_file): Strip \r from lines. Fixes DOS
authorJan Nieuwenhuizen <janneke@gnu.org>
Thu, 8 Apr 2004 10:34:51 +0000 (10:34 +0000)
committerJan Nieuwenhuizen <janneke@gnu.org>
Thu, 8 Apr 2004 10:34:51 +0000 (10:34 +0000)
flavour abc files (backportme).

ChangeLog
THANKS
scripts/abc2ly.py

index fc5218d356e3b3bbe20a2960b8a9c1d7a819ff2f..4bcb4ef14bc5baac655b40aa028c744cb8963801 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2004-04-08  Jan Nieuwenhuizen  <janneke@gnu.org>
+
+       * scripts/abc2ly.py (parse_file): Strip \r from lines.  Fixes DOS
+       flavour abc files (backportme).
+
 2004-04-08  Han-Wen Nienhuys   <hanwen@xs4all.nl>
 
        * lily/scaled-font-metric.cc (text_dimension): only multiply with
diff --git a/THANKS b/THANKS
index ebcd179d2defedd3fffdd23b5ce6e5493d0d4993..ee60553ef35f0abd1123c88eb5e81c0407ace2bd 100644 (file)
--- a/THANKS
+++ b/THANKS
@@ -18,6 +18,7 @@ BUG HUNTERS/SUGGESTIONS
 
 David Bobroff
 Stephen Pollei
+Peter Rosenbeck
 
 Release 2.2
 ***********
index df73f4079355c43941af61566d32808dcc35f30c..534c6a8b7fd7d4ca14ad96dd6f86fec31e85a685 100644 (file)
@@ -401,10 +401,10 @@ def lily_key (k):
                return '%s \\major' % key
 
        type = k[0:3]
-       if key_lookup.has_key(type):
-               return("%s \\%s" % ( key, key_lookup[type]))
-       sys.stderr.write("Unknown key type `%s' ignored\n" % type)
-       return key
+       if key_lookup.has_key (type):
+               return ("%s \\%s" % ( key, key_lookup[type]))
+       sys.stderr.write ("Unknown key type `%s' ignored\n" % type)
+       return ""
 
 def shift_key (note, acc , shift):
         s = semitone_pitch((note, acc))
@@ -1209,6 +1209,7 @@ happy_count = 100
 def parse_file (fn):
        f = open (fn)
        ls = f.readlines ()
+       ls = map (lambda x: re.sub ("\r$", '', x), ls)
 
        select_voice('default', '')
        lineno = 0