From 57eef4bd7d12ea4d0723f4ef18213a8b4bdc3321 Mon Sep 17 00:00:00 2001 From: John Mandereau Date: Wed, 27 Feb 2008 16:19:10 +0100 Subject: [PATCH] Only print base name in lilypond-book printfilename option This should fix file names with absolute paths in regtests compiled with GUB. --- Documentation/user/lilypond-book.itely | 5 +++-- buildscripts/lys-to-tely.py | 4 ++-- scripts/lilypond-book.py | 2 +- 3 files changed, 6 insertions(+), 5 deletions(-) diff --git a/Documentation/user/lilypond-book.itely b/Documentation/user/lilypond-book.itely index 6196811450..edafa9e528 100644 --- a/Documentation/user/lilypond-book.itely +++ b/Documentation/user/lilypond-book.itely @@ -700,8 +700,9 @@ useful if you want to @code{quote} the music snippet but not the @item printfilename If a LilyPond input file is included with @code{\lilypondfile}, print -the file name right before the music snippet. For HTML output, this is -a link. +the file name right before the music snippet. For HTML output, this +is a link. Only the base name of the file is printed, i.e. the +directory part of the file path is stripped. @item fontload This option includes fonts in all of the generated EPS-files for this diff --git a/buildscripts/lys-to-tely.py b/buildscripts/lys-to-tely.py index c026522434..22aff30be5 100644 --- a/buildscripts/lys-to-tely.py +++ b/buildscripts/lys-to-tely.py @@ -85,11 +85,11 @@ def name2line (n): s = r""" @ifhtml @html - + @end html @end ifhtml -@lilypondfile[%s]{%s}""" % (n, fragment_options, n) +@lilypondfile[%s]{%s}""" % (os.path.basename (n), fragment_options, n) return s if files: diff --git a/scripts/lilypond-book.py b/scripts/lilypond-book.py index dee8223de6..96c5dcc9c5 100644 --- a/scripts/lilypond-book.py +++ b/scripts/lilypond-book.py @@ -1244,7 +1244,7 @@ class Lilypond_snippet (Snippet): str = '' if PRINTFILENAME in self.option_dict: base = self.basename () - filename = self.substring ('filename') + filename = os.path.basename (self.substring ('filename')) str = output[global_options.format][PRINTFILENAME] % vars () return str -- 2.39.5