]> git.donarmstrong.com Git - lilypond.git/blobdiff - scripts/build/lys-to-tely.py
Avoids TupletBracket vs Fingering and TupletBracket vs StringNumber collisions.
[lilypond.git] / scripts / build / lys-to-tely.py
index a911e02aa2e02d5b99b42b21476f65b0eee62046..a868ea2903395ebadec6f19383d183810a2170a9 100644 (file)
@@ -14,6 +14,7 @@ import sys
 import os
 import getopt
 import re
+import glob
 
 program_name = 'lys-to-tely'
 
@@ -28,6 +29,7 @@ Options:
    options
  -o, --output=NAME              write tely doc to NAME
  -i, --input-filenames=NAME     read list of files from a file instead of stdin
+ -g, --glob-input=GLOB          a string which will be passed to glob.glob(GLOB)
  -t, --title=TITLE              set tely doc title TITLE
  -a, --author=AUTHOR            set tely author AUTHOR
      --template=TEMPLATE        use TEMPLATE as Texinfo template file,
@@ -43,12 +45,13 @@ def help (text):
 (options, files) = getopt.getopt (sys.argv[1:], 'f:hn:t:',
                      ['fragment-options=', 'help', 'name=',
                      'title=', 'author=', 'template=',
-                     'input-filenames='])
+                     'input-filenames=', 'glob-input='])
 
 name = "ly-doc"
 title = "Ly Doc"
 author = "Han-Wen Nienhuys and Jan Nieuwenhuizen"
 input_filename = ""
+glob_input = ""
 template = '''\input texinfo
 @setfilename %%(name)s.info
 @settitle %%(title)s
@@ -90,6 +93,8 @@ for opt in options:
         author = a
     elif o == '-i' or o == '--input-filenames':
         input_filename = a
+    elif o == '-p' or o == '--glob-input':
+        glob_input = a
     elif o == '-f' or o == '--fragment-options':
         fragment_options = a
     elif o == '--template':
@@ -143,8 +148,10 @@ def name2line (n):
 """ % (os.path.basename (n), fragment_options, n)
     return s
 
-if input_filename:
-    files = open(input_filename).read().splitlines()
+if glob_input:
+    files = glob.glob(glob_input)
+elif input_filename:
+    files = open(input_filename).read().split()
 
 if files:
     dir = os.path.dirname (name) or "."