X-Git-Url: https://git.donarmstrong.com/?a=blobdiff_plain;f=scripts%2Flilypond-book.py;h=d42a77a78760c551d5b5ec76d38766ee35be878b;hb=2b8f3241e3c840434fc675e6974ca5bf8dc3fd93;hp=9998f1ceec367277a181091b4646479e1c3c2af1;hpb=65f7a3993db06204af81a68f86a74efeb353d539;p=lilypond.git diff --git a/scripts/lilypond-book.py b/scripts/lilypond-book.py index 9998f1ceec..d42a77a787 100644 --- a/scripts/lilypond-book.py +++ b/scripts/lilypond-book.py @@ -51,6 +51,17 @@ ly.require_python_version () program_version = '@TOPLEVEL_VERSION@' program_name = os.path.basename (sys.argv[0]) +# Check if program_version contains @ characters. This will be the case if +# the .py file is called directly while building the lilypond documentation. +# If so, try to check for the env var LILYPOND_VERSION, which is set by our +# makefiles and use its value. +at_re = re.compile (r'@') +if at_re.match (program_version): + if os.environ.has_key('LILYPOND_VERSION'): + program_version = os.environ['LILYPOND_VERSION'] + else: + program_version = "unknown" + original_dir = os.getcwd () backend = 'ps'