]> git.donarmstrong.com Git - lilypond.git/blobdiff - scripts/midi2ly.py
(Introduction): rewrite
[lilypond.git] / scripts / midi2ly.py
index 3b3f00dd9eb7a0ddd886b67acbb3036ef7ca6701..fc9942254bcc8f4c30625da1f65d098c5d62f9d3 100644 (file)
@@ -4,7 +4,7 @@
 # 
 # source file of the GNU LilyPond music typesetter
 #
-# (c) 1998--2002  Han-Wen Nienhuys <hanwen@cs.uu.nl>
+# (c)  1998--2003  Han-Wen Nienhuys <hanwen@cs.uu.nl>
 #                 Jan Nieuwenhuizen <janneke@gnu.org>
 
 
@@ -31,17 +31,13 @@ import sys
 ################################################################
 # Users of python modules should include this snippet.
 #
-# If set, LILYPONDPREFIX must take prevalence
-# if datadir is not set, we're doing a build and LILYPONDPREFIX
-datadir = '@local_lilypond_datadir@'
-if not os.path.isdir (datadir):
-       datadir = '@lilypond_datadir@'
-if os.environ.has_key ('LILYPONDPREFIX') :
-       datadir = os.environ['LILYPONDPREFIX']
-       while datadir[-1] == os.sep:
-               datadir= datadir[:-1]
-
-sys.path.insert (0, os.path.join (datadir, 'python'))
+# This soon to be removed for: import lilypond.lilylib as ly
+libdir = '@local_lilypond_libdir@'
+if not os.path.isdir (libdir):
+       libdir = '@lilypond_libdir@'
+sys.path.insert (0, os.path.join (libdir, 'python'))
+
+
 ################################################################
 
 import midi
@@ -137,7 +133,7 @@ def identify ():
 def warranty ():
        identify ()
        sys.stdout.write ('\n')
-       sys.stdout.write (_ ('Copyright (c) %s by' % ' 2001--2002'))
+       sys.stdout.write (_ ('Copyright (c) %s by' % ' 2001--2003'))
        sys.stdout.write ('\n')
        sys.stdout.write ('  Han-Wen Nienhuys')
        sys.stdout.write ('  Jan Nieuwenhuizen')
@@ -450,7 +446,8 @@ class Note:
                elif commas < 0:
                        s = s + "," * -commas
 
-               if and dump_dur (explicit_durations_p \
+               ## FIXME: compile fix --jcn
+               if dump_dur and (explicit_durations_p \
                   or Duration.compare (self.duration,
                                        reference_note.duration)):
                        s = s + self.duration.dump ()