X-Git-Url: https://git.donarmstrong.com/?a=blobdiff_plain;f=scripts%2Fmusicxml2ly.py;h=f3fd9a7a06131cb467fe4d95f274acdebb3f49af;hb=198f4d748307a3d6d8be3bb29e4197606f24b6b8;hp=5f25567c592909beb52fca77bedffcb433fd9cbc;hpb=789e77d3324692119a130bc5eb6a003fbcf9e9c7;p=lilypond.git diff --git a/scripts/musicxml2ly.py b/scripts/musicxml2ly.py index 5f25567c59..f3fd9a7a06 100644 --- a/scripts/musicxml2ly.py +++ b/scripts/musicxml2ly.py @@ -9,30 +9,19 @@ from gettext import gettext as _ - -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] - -if os.path.exists (os.path.join (datadir, 'share/lilypond/@TOPLEVEL_VERSION@/')): - datadir = os.path.join (datadir, 'share/lilypond/@TOPLEVEL_VERSION@/') -elif os.path.exists (os.path.join (datadir, 'share/lilypond/current/')): - 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] - -for prefix_component in ['share', 'lib']: - datadir = os.path.abspath (bindir + '/../%s/lilypond/current/python/' % prefix_component) +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, datadir) + + import lilylib as ly import musicxml