]> git.donarmstrong.com Git - lilypond.git/blob - python/relocate-preamble.py.in
Web-ja: update introduction
[lilypond.git] / python / relocate-preamble.py.in
1 This generic code used for all python scripts.
2
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.
7
8 """
9
10 for d in ['@lilypond_datadir@',
11           '@lilypond_libdir@']:
12     sys.path.insert (0, os.path.join (d, 'python'))
13
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)
19 """