From 42b6a1852760ac7f46ce894e82a64bbe6c2cff70 Mon Sep 17 00:00:00 2001 From: John Gourlay Date: Fri, 4 Mar 2016 22:27:02 -0500 Subject: [PATCH] Handle LilyPond version better. --- python/musicexp.py | 4 ++-- scripts/musicxml2ly.py | 6 ++++-- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/python/musicexp.py b/python/musicexp.py index a0b13efcc6..c2c2b1b60d 100644 --- a/python/musicexp.py +++ b/python/musicexp.py @@ -57,8 +57,8 @@ class Output_printer(object): def set_file (self, file): self._file = file - def dump_version (self): - self.print_verbatim ('\\version "2.19.15"') + def dump_version (self, version): + self.print_verbatim ('\\version "' + version + '"') self.newline () def get_indent (self): diff --git a/scripts/musicxml2ly.py b/scripts/musicxml2ly.py index fa6e69c0ce..7c5dc69c1a 100644 --- a/scripts/musicxml2ly.py +++ b/scripts/musicxml2ly.py @@ -2776,7 +2776,7 @@ If the given filename is -, musicxml2ly reads from the command line. action="help", help=_("show this help and exit")) - p.version = ('''%prog (LilyPond) @TOPLEVEL_VERSION@\n\n''' + p.version = ('%prog (LilyPond) ' + lilypond_version + '\n\n' + _ ("""Copyright (c) 2005--2015 by Han-Wen Nienhuys , @@ -3056,7 +3056,7 @@ def update_layout_information(): # \n\t\t\t\t\\override StringNumber #\'stencil = ##f def print_ly_preamble(printer, filename): - printer.dump_version() + printer.dump_version(lilypond_version) printer.print_verbatim('% automatically converted by philomelos musicxml2ly v0.2.41\n') printer.newline() printer.dump(r'\pointAndClickOff') @@ -3217,6 +3217,8 @@ def get_existing_filename_with_extension(filename, ext): def main(): + global lilypond_version + lilypond_version = "@TOPLEVEL_VERSION@" opt_parser = option_parser() global options -- 2.39.2