]> git.donarmstrong.com Git - lilypond.git/blobdiff - scripts/abc2ly.py
(datadir): remove LILYPONDPREFIX support.
[lilypond.git] / scripts / abc2ly.py
index 664d73ec481ffebf47f1f8a640bc1d0759c7a177..ba60c1cfeeb447230de77f191f2020c2e31f1576 100644 (file)
@@ -1,4 +1,4 @@
-#!@PYTHON@
+#!@TARGET_PYTHON@
 # -*- coding: utf-8 -*-
 # once upon a rainy monday afternoon.
 #
@@ -77,25 +77,16 @@ import os
 program_name = sys.argv[0]
 
 
-datadir = '@local_lilypond_datadir@'
-if not os.path.isdir (datadir):
-    datadir = '@lilypond_datadir@'
-
-sys.path.insert (0, os.path.join (datadir, 'python'))
-
-if os.environ.has_key ('LILYPONDPREFIX'):
-    datadir = os.environ['LILYPONDPREFIX']
-    while datadir[-1] == os.sep:
-        datadir= datadir[:-1]
-        
-    datadir = os.path.join (datadir, "share/lilypond/current/")
-sys.path.insert (0, os.path.join (datadir, 'python'))
+for d in ['@lilypond_datadir@',
+          '@lilypond_libdir@']:
+    sys.path.insert (0, os.path.join (d, 'python'))
 
 # dynamic relocation, for GUB binaries.
-bindir = os.path.split (sys.argv[0])[0]
+bindir = os.path.abspath (os.path.split (sys.argv[0])[0])
 for p in ['share', 'lib']:
     datadir = os.path.abspath (bindir + '/../%s/lilypond/current/python/' % p)
-    sys.path.insert (0, os.path.join (datadir))
+    sys.path.insert (0, datadir)
+
 
 import lilylib as ly
 global _;_=ly._
@@ -536,7 +527,7 @@ def try_parse_tuplet_begin (str, state):
         dig = str[1]
         str = str[2:]
         prev_tuplet_state = state.parsing_tuplet
-         state.parsing_tuplet = string.atoi (dig[0])
+        state.parsing_tuplet = string.atoi (dig[0])
         if prev_tuplet_state:
             voices_append ("}")                
         voices_append ("\\times %s {" % tup_lookup[dig])