summaryrefslogtreecommitdiff
path: root/scripts/midi2ly.py
diff options
context:
space:
mode:
Diffstat (limited to 'scripts/midi2ly.py')
-rw-r--r--scripts/midi2ly.py10
1 files changed, 8 insertions, 2 deletions
diff --git a/scripts/midi2ly.py b/scripts/midi2ly.py
index 8726c8d59f..369e6df4cb 100644
--- a/scripts/midi2ly.py
+++ b/scripts/midi2ly.py
@@ -30,12 +30,18 @@ import sys
################################################################
# Users of python modules should include this snippet.
#
-# 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'))
+# ugh
+if os.environ.has_key ('LILYPONDPREFIX'):
+ datadir = os.environ['LILYPONDPREFIX']
+ while datadir[-1] == os.sep:
+ datadir= datadir[:-1]
+ libdir = datadir.replace ('/share/', '/lib/')
+
+sys.path.insert (0, os.path.join (libdir, 'python'))
################################################################