X-Git-Url: https://git.donarmstrong.com/?a=blobdiff_plain;f=buildscripts%2Flys-to-tely.py;h=c9d698f92cea0764b2e608a7bda5c4b75b9f35a6;hb=4275096e4a15134ab277b72d9828959d4f5712f1;hp=e74c7145034e26f715bb73dfb04da015aef57c39;hpb=5cfe4870e6871699219fa7a27a27d852d47bc54f;p=lilypond.git diff --git a/buildscripts/lys-to-tely.py b/buildscripts/lys-to-tely.py old mode 100755 new mode 100644 index e74c714503..c9d698f92c --- a/buildscripts/lys-to-tely.py +++ b/buildscripts/lys-to-tely.py @@ -12,6 +12,7 @@ TODO: import sys import os import getopt +import re program_name = 'lys-to-tely' @@ -85,8 +86,15 @@ for opt in options: else: raise Exception ('unknown option: ' + o) +texi_file_re = re.compile ('.*\.i?te(ly|xi)$') + def name2line (n): - s = r""" + if texi_file_re.match (n): + # We have a texi include file, simply include it: + s = r"@include %s" % os.path.basename (n) + else: + # Assume it's a lilypond file -> create image etc. + s = r""" @ifhtml @html @@ -103,7 +111,6 @@ if files: name = os.path.basename (name) template = template % vars () - files.sort () s = "\n".join (map (name2line, files)) s = template.replace (include_snippets, s, 1) f = "%s/%s" % (dir, name)