From: John Mandereau Date: Wed, 27 Feb 2008 15:19:10 +0000 (+0100) Subject: Only print base name in lilypond-book printfilename option X-Git-Tag: release/2.11.42-1~7^2~15^2~18 X-Git-Url: https://git.donarmstrong.com/?a=commitdiff_plain;h=57eef4bd7d12ea4d0723f4ef18213a8b4bdc3321;p=lilypond.git Only print base name in lilypond-book printfilename option This should fix file names with absolute paths in regtests compiled with GUB. --- 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