1 This generic code used
for all python scripts
.
3 The quotes are to ensure that the source
.py
file can still be
4 run
as a python script
, but does
not include any sys
.path handling
.
5 Otherwise
, the lilypond
-book calls inside the build
6 might modify installed
.pyc files
.
10 for d in ['@lilypond_datadir@',
12 sys.path.insert (0, os.path.join (d, 'python'))
14 # dynamic relocation, for GUB binaries.
15 bindir = os.path.abspath (os.path.dirname (sys.argv[0]))
16 for p in ['share', 'lib']:
17 datadir = os.path.abspath (bindir + '/../%s/lilypond/current/python/' % p)
18 sys.path.insert (0, datadir)