From 340d7b49e816a5930ae39e17212415f16c8d152d Mon Sep 17 00:00:00 2001 From: Graham Percival Date: Mon, 29 Aug 2011 02:44:59 +0100 Subject: [PATCH] lys-to-tely.py: read from a file instead of stdin --- scripts/build/lys-to-tely.py | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/scripts/build/lys-to-tely.py b/scripts/build/lys-to-tely.py index 4b2e232053..a911e02aa2 100644 --- a/scripts/build/lys-to-tely.py +++ b/scripts/build/lys-to-tely.py @@ -6,6 +6,7 @@ TODO: * Add @nodes, split at sections? + * -o --output listed in help is not implemented?! ''' @@ -26,6 +27,7 @@ Options: -f, --fragment-options=OPTIONS use OPTIONS as lilypond-book fragment options -o, --output=NAME write tely doc to NAME + -i, --input-filenames=NAME read list of files from a file instead of stdin -t, --title=TITLE set tely doc title TITLE -a, --author=AUTHOR set tely author AUTHOR --template=TEMPLATE use TEMPLATE as Texinfo template file, @@ -39,11 +41,14 @@ def help (text): sys.exit (0) (options, files) = getopt.getopt (sys.argv[1:], 'f:hn:t:', - ['fragment-options=', 'help', 'name=', 'title=', 'author=', 'template=']) + ['fragment-options=', 'help', 'name=', + 'title=', 'author=', 'template=', + 'input-filenames=']) name = "ly-doc" title = "Ly Doc" author = "Han-Wen Nienhuys and Jan Nieuwenhuizen" +input_filename = "" template = '''\input texinfo @setfilename %%(name)s.info @settitle %%(title)s @@ -83,6 +88,8 @@ for opt in options: title = a elif o == '-a' or o == '--author': author = a + elif o == '-i' or o == '--input-filenames': + input_filename = a elif o == '-f' or o == '--fragment-options': fragment_options = a elif o == '--template': @@ -136,6 +143,9 @@ def name2line (n): """ % (os.path.basename (n), fragment_options, n) return s +if input_filename: + files = open(input_filename).read().splitlines() + if files: dir = os.path.dirname (name) or "." # don't strip .tely extension, Documentation/snippets uses .itely -- 2.39.5