File: relocate-preamble.py.in

package info (click to toggle)
lilypond 2.19.81+really-2.18.2-13
  • links: PTS, VCS
  • area: main
  • in suites: buster, sid
  • size: 68,528 kB
  • sloc: cpp: 76,619; ansic: 75,407; lisp: 56,140; xml: 31,046; python: 20,799; sh: 7,946; yacc: 3,266; perl: 3,045; asm: 1,587; lex: 1,405; makefile: 1,048; tcl: 457; awk: 199; php: 53; csh: 50
file content (19 lines) | stat: -rw-r--r-- 622 bytes parent folder | download | duplicates (6)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
This generic code used for all python scripts.

The quotes are to ensure that the source .py file can still be
run as a python script, but does not include any sys.path handling.
Otherwise, the lilypond-book calls inside the build
might modify installed .pyc files.

"""

for d in ['@lilypond_datadir@',
	  '@lilypond_libdir@']:
    sys.path.insert (0, os.path.join (d, 'python'))

# dynamic relocation, for GUB binaries.
bindir = os.path.abspath (os.path.dirname (sys.argv[0]))
for p in ['share', 'lib']:
    datadir = os.path.abspath (bindir + '/../%s/lilypond/current/python/' % p)
    sys.path.insert (0, datadir)
"""