X-Git-Url: https://git.donarmstrong.com/?a=blobdiff_plain;f=scripts%2Fetf2ly.py;h=a5291e92ad94eac4be03ade05c1ee09da3983822;hb=9f3572d98bb948c9689cd1f75401a029451fa001;hp=0e85317a2ee9791c25c6d238422f9c54cacab9c8;hpb=04265f11d1f21416ccebd2dcaa1d903dc781b36e;p=lilypond.git diff --git a/scripts/etf2ly.py b/scripts/etf2ly.py index 0e85317a2e..a5291e92ad 100644 --- a/scripts/etf2ly.py +++ b/scripts/etf2ly.py @@ -43,22 +43,32 @@ if version == '@' + 'TOPLEVEL_VERSION' + '@': ################################################################ # Users of python modules should include this snippet. # - - - - -for d in ['@lilypond_datadir@', - '@lilypond_libdir@']: - sys.path.insert (0, os.path.join (d, 'python')) - +libdir = '@local_lilypond_libdir@' +if not os.path.isdir (libdir): + libdir = '@lilypond_libdir@' + +# ugh +datadir = '@local_lilypond_datadir@' +if os.environ.has_key ('LILYPONDPREFIX'): + datadir = os.environ['LILYPONDPREFIX'] + while datadir[-1] == os.sep: + datadir= datadir[:-1] + libdir = datadir.replace ('/share/', '/lib/') + +if os.path.exists (os.path.join (datadir, 'lib/lilypond/@TOPLEVEL_VERSION@/')): + libdir = os.path.join (libdir, 'lib/lilypond/@TOPLEVEL_VERSION@/') + +if os.path.exists (os.path.join (datadir, 'lib/lilypond/current/')): + libdir = os.path.join (libdir, 'lib/lilypond/current/') + +sys.path.insert (0, os.path.join (libdir, 'python')) # dynamic relocation, for GUB binaries. -bindir = os.path.abspath (os.path.split (sys.argv[0])[0]) +bindir = 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, datadir) - ################################################################ import lilylib as ly