7 * Add @nodes, plit at sections?
8 * Less kludged first introduction file
9 * include *.texi files for text at start of section?
19 program_name
= 'lys-to-tely'
22 sys
.stdout
.write (r
"""Usage: lys-to-tely [OPTION]... LY-FILE...
23 Construct tely doc from LY-FILEs.
26 -h, --help print this help
27 -o,output=NAME write tely doc to NAME
28 -t,title=TITLE set tely tely doc title TITLE
32 (options
, files
) = getopt
.getopt(sys
.argv
[1:], 'hn:t:', [
33 'help', 'name=', 'title='])
40 if o
== '-h' or o
== '--help':
42 elif o
== '-n' or o
== '--name':
44 elif o
== '-t' or o
== '--title':
47 raise 'unknown opt ', o
49 def strip_extension (f
, ext
):
50 (p
, e
) = os
.path
.splitext (f
)
56 dir = os
.path
.dirname (name
)
59 name
= strip_extension (os
.path
.basename (name
), ".tely")
67 @author Han-Wen Nienhuys and Jan Nieuwenhuizen
72 ''' % (name
, title
, title
)
76 s
= "@lilypondfile[printfilename]{%s}" % n
79 s
= s
+ string
.join (map (lambda x
: name2line (x
), files
), "\n")
81 f
= "%s/%s.tely" % (dir, name
)
82 sys
.stderr
.write ("%s: writing %s..." % (program_name
, f
))
86 sys
.stderr
.write ('\n')
88 # not Unix philosophy, but hey, at least we notice when
89 # we don't distribute any .ly files.
90 sys
.stderr
.write ("No files specified. Doing nothing")