X-Git-Url: https://git.donarmstrong.com/?a=blobdiff_plain;f=scripts%2Flilypond-book.py;h=5a6565bc58c6d9a4390e872b72d747e4110e8358;hb=5b4b0d6e9a197e8f9eb085b7c2ad78b8be3e5cfc;hp=9998f1ceec367277a181091b4646479e1c3c2af1;hpb=4681aa8f55d829e119b4c6dc630375e6d1234e4c;p=lilypond.git diff --git a/scripts/lilypond-book.py b/scripts/lilypond-book.py index 9998f1ceec..5a6565bc58 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' @@ -101,7 +112,7 @@ def warranty (): %s %s -''' % ( _ ('Copyright (c) %s by') % '2001--2007', +''' % ( _ ('Copyright (c) %s by') % '2001--2008', ' '.join (authors), _ ("Distributed under terms of the GNU General Public License."), _ ("It comes with NO WARRANTY."))) @@ -526,7 +537,7 @@ snippet_res = { 'lilypondversion': r'''(?mx) - (?P + [^@](?P @lilypondversion)[^a-zA-Z]''', },