5 ly-options: intertext, quote ?
8 check latex parameters, twocolumn, multicolumn?
13 lilypond-book --filter="tr '[a-z]' '[A-Z]'" BOOK
16 lilypond-book --filter="convert-ly --no-version --from=1.6.11 -" BOOK
18 classic lilypond-book:
19 lilypond-book --process="lilypond-bin" BOOK.tely
22 @mbinclude foo.itely -> @include foo.itely
31 ################################################################
32 # Users of python modules should include this snippet
33 # and customize variables below.
35 # We'll suffer this path init stuff as long as we don't install our
36 # python packages in <prefix>/lib/pythonx.y (and don't kludge around
37 # it as we do with teTeX on Red Hat Linux: set some environment var
38 # (PYTHONPATH) in profile)
40 # If set, LILYPONDPREFIX must take prevalence
41 # if datadir is not set, we're doing a build and LILYPONDPREFIX
42 import getopt, os, sys
43 datadir = '@local_lilypond_datadir@'
44 if not os.path.isdir (datadir):
45 datadir = '@lilypond_datadir@'
46 if os.environ.has_key ('LILYPONDPREFIX') :
47 datadir = os.environ['LILYPONDPREFIX']
48 while datadir[-1] == os.sep:
51 sys.path.insert (0, os.path.join (datadir, 'python'))
54 #if __name__ == '__main__':
62 program_version = '@TOPLEVEL_VERSION@'
63 program_name = 'lilypond-book'
66 original_dir = os.getcwd ()
69 help_summary = _ ("""Process LilyPond snippets in hybrid HTML, LaTeX or texinfo document. Example usage:
71 lilypond-book --filter="tr '[a-z]' '[A-Z]'" BOOK
72 lilypond-book --filter="convert-ly --no-version --from=2.0.0 -" BOOK
73 lilypond-book --process='lilypond-bin -I include' BOOK
77 copyright = ('Jan Nieuwenhuizen <janneke@gnu.org>',
78 'Han-Wen Nienhuys <hanwen@cs.uu.nl>')
80 option_definitions = [
81 (_ ("EXT"), 'f', 'format', _ ("use output format EXT (texi [default], texi-html, latex, html)")),
82 (_ ("FILTER"), 'F', 'filter', _ ("pipe snippets through FILTER [convert-ly -n -]")),
83 ('', 'h', 'help', _ ("print this help")),
84 (_ ("DIR"), 'I', 'include', _ ("add DIR to include path")),
85 (_ ("COMMAND"), 'P', 'process', _ ("process ly_files using COMMAND FILE...")),
86 (_ ("DIR"), 'o', 'output', _ ("write output to DIR")),
87 ('', 'V', 'verbose', _ ("be verbose")),
88 ('', 'v', 'version', _ ("print version information")),
89 ('', 'w', 'warranty', _ ("show warranty and copyright")),
92 include_path = [ly.abspath (os.getcwd ())]
93 lilypond_binary = os.path.join ('@bindir@', 'lilypond-bin')
95 # only use installed binary when we're installed too.
96 if '@bindir@' == ('@' + 'bindir@') or not os.path.exists (lilypond_binary):
97 lilypond_binary = 'lilypond-bin'
103 latex_filter_cmd = 'latex "\\nonstopmode \input /dev/stdin"'
105 process_cmd = lilypond_binary
106 default_ly_options = {}
111 FRAGMENT = 'fragment'
114 LINEWIDTH = 'linewidth'
115 NOFRAGMENT = 'nofragment'
119 PREAMBLE = 'preamble'
120 PRINTFILENAME = 'printfilename'
121 RAGGEDRIGHT = 'raggedright'
122 RELATIVE = 'relative'
123 STAFFSIZE = 'staffsize'
126 VERBATIM = 'verbatim'
128 # Recognize special sequences in the input
130 # (?P<name>regex) -- assign result of REGEX to NAME
131 # *? -- match non-greedily.
132 # (?m) -- multiline regex: make ^ and $ match at each line
133 # (?s) -- make the dot match all characters including newline
138 'lilypond' : '(?m)(?P<match><lilypond((?P<options>[^:]*):)(?P<code>.*?)/>)',
139 'lilypond_block': r'''(?ms)(?P<match><lilypond(?P<options>[^>]+)?>(?P<code>.*?)</lilypond>)''',
140 'lilypond_file': r'(?m)(?P<match><lilypondfile(?P<options>[^>]+)?>\s*(?P<filename>[^<]+)\s*</lilypondfile>)',
141 'multiline_comment': r"(?sm)\s*(?!@c\s+)(?P<code><!--\s.*?!-->)\s",
142 'singleline_comment': no_match,
143 'verb': r'''(?P<code><pre>.*?</pre>)''',
144 'verbatim': r'''(?s)(?P<code><pre>\s.*?</pre>\s)''',
148 'include': r'(?m)^[^%\n]*?(?P<match>\\input{(?P<filename>[^}]+)})',
149 'lilypond' : r'(?m)^[^%\n]*?(?P<match>\\lilypond\s*(\[(?P<options>.*?)\])?\s*{(?P<code>.*?)})',
150 'lilypond_block': r"(?sm)^[^%\n]*?(?P<match>\\begin\s*(\[(?P<options>.*?)\])?\s*{lilypond}(?P<code>.*?)\\end{lilypond})",
151 'lilypond_file': r'(?m)^[^%\n]*?(?P<match>\\lilypondfile\s*(\[(?P<options>.*?)\])?\s*\{(?P<filename>.+)})',
152 'multiline_comment': no_match,
153 'singleline_comment': r"(?m)^.*?(?P<match>(?P<code>^%.*$\n+))",
154 'verb': r"(?P<code>\\verb(?P<del>.).*?(?P=del))",
155 'verbatim': r"(?s)(?P<code>\\begin\s*{verbatim}.*?\\end{verbatim})",
159 'include': '(?m)^[^%\n]*?(?P<match>@include\s+(?P<filename>\S+))',
160 'lilypond' : '(?m)^(?P<match>@lilypond(\[(?P<options>[^]]*)\])?{(?P<code>.*?)})',
161 'lilypond_block': r'''(?ms)^(?P<match>@lilypond(\[(?P<options>[^]]*)\])?\s(?P<code>.*?)@end lilypond)\s''',
162 'lilypond_file': '(?m)^(?P<match>@lilypondfile(\[(?P<options>[^]]*)\])?{(?P<filename>[^}]+)})',
163 'multiline_comment': r'(?sm)^\s*(?!@c\s+)(?P<code>@ignore\s.*?@end\s+ignore)\s',
164 'singleline_comment': r'(?m)^.*(?P<match>(?P<code>@c([ \t][^\n]*|)\n))',
166 # don't do this: fucks up with @code{@{}
167 # 'verb': r'''(?P<code>@code{.*?})''',
168 'verbatim': r'''(?s)(?P<code>@example\s.*?@end\s+example\s)''',
174 'option-sep' : '\s*',
175 'intertext': r',?\s*intertext=\".*?\"',
178 'intertext': r',?\s*intertext=\".*?\"',
179 'option-sep' : ',\s*',
182 'intertext': r',?\s*intertext=\".*?\"',
183 'option-sep' : ',\s*',
189 RELATIVE: r'''\relative c%(relative_quotes)s''',
193 indent = %(indent)s''',
195 linewidth = %(linewidth)s''',
201 \remove Time_signature_engraver
205 raggedright = ##t''',
209 #(set-global-staff-size %(staffsize)s)''',
215 FILTER: r'''<lilypond %(options)s>
225 <a href="%(base)s.ly">''',
227 <img align="center" valign="center"
228 border="0" src="%(image)s" alt="[image of music]">''',
229 PRINTFILENAME:'<p><tt><a href="%(base)s.ly">%(filename)s</a></tt></p>',
237 OUTPUT: r'''{\parindent 0pt
239 \ifx\preLilyPondExample\preLilyPondExample\fi
242 \ifx\preLilyPondExample\postLilyPondExample\fi
244 PRINTFILENAME: '''\\texttt{%(filename)s}
247 VERBATIM: r'''\begin{verbatim}
248 %(verb)s\end{verbatim}
250 FILTER: r'''\begin{lilypond}[%(options)s]
256 FILTER: r'''@lilypond[%(options)s]
262 @image{%(base)s,,,[image of music],%(ext)s}
264 PRINTFILENAME: '''@file{%(filename)s}
267 VERBATIM: r'''@example
273 PREAMBLE_LY = r'''%% Generated by %(program_name)s
274 %% Options: [%(option_string)s]
276 \paper {%(paper_string)s
280 FRAGMENT_LY = r'''\score{
281 \notes%(notes_string)s{
286 texinfo_linewidths = {
287 '@afourpaper': '160 \\mm',
288 '@afourwide': '6.5 \\in',
289 '@afourlatex': '150 \\mm',
290 '@smallbook': '5 \\in' ,
291 '@letterpaper': '6\\in',
294 def classic_lilypond_book_compatibility (o):
295 if o == 'singleline':
297 m = re.search ('relative\s*([-0-9])', o)
299 return 'relative=%s' % m.group (1)
300 m = re.match ('([0-9]+)pt', o)
302 return 'staffsize=%s' % m.group (1)
303 m = re.match ('indent=([-.0-9]+)(cm|in|mm|pt)', o)
305 f = float (m.group (1))
306 return 'indent=%f\\%s' % (f, m.group (2))
307 m = re.match ('linewidth=([-.0-9]+)(cm|in|mm|pt)', o)
309 f = float (m.group (1))
310 return 'linewidth=%f\\%s' % (f, m.group (2))
313 def compose_ly (code, options):
315 for i in default_ly_options.keys ():
319 m = re.search (r'''\\score''', code)
320 if not m and (not options \
321 or not NOFRAGMENT in options or FRAGMENT in options):
322 if RAGGEDRIGHT not in options:
323 options.append (RAGGEDRIGHT)
332 override.update (default_ly_options)
334 option_string = string.join (options, ',')
337 preamble_options = []
339 c = classic_lilypond_book_compatibility (i)
341 ly.warning (_ ("deprecated ly-option used: %s" % i))
342 ly.warning (_ ("compatibility mode translation: %s" \
346 if string.find (i, '=') > 0:
347 key, value = string.split (i, '=')
348 override[key] = value
351 if i not in override.keys ():
354 if key in ly_options[NOTES].keys ():
355 notes_options.append (ly_options[NOTES][key])
356 elif key in ly_options[PREAMBLE].keys ():
357 preamble_options.append (ly_options[PREAMBLE][key])
358 elif key in ly_options[PAPER].keys ():
359 paper_options.append (ly_options[PAPER][key])
360 elif key not in (FRAGMENT, NOFRAGMENT, PRINTFILENAME,
361 RELATIVE, VERBATIM, TEXIDOC):
362 ly.warning (_("ignoring unknown ly option: %s") % i)
365 if RELATIVE in override.keys () and override[RELATIVE]:
366 relative = string.atoi (override[RELATIVE])
372 relative_quotes += ',' * (- relative)
374 relative_quotes += "'" * relative
376 program_name = __main__.program_name
377 paper_string = string.join (paper_options, '\n ') % override
378 preamble_string = string.join (preamble_options, '\n ') % override
379 notes_string = string.join (notes_options, '\n ') % vars ()
380 return (PREAMBLE_LY + body) % vars ()
383 # use lilypond-bin for latex (.lytex) books,
384 # and lilypond --preview for html, texinfo books?
386 cmd = r'latex "\nonstopmode \input %s"' % file
387 # Ugh. (La)TeX writes progress and error messages on stdout
389 cmd = '(( %s >&2 ) >&- )' % cmd
391 ly.system ('dvips -Ppdf -u+lilypond.map -E -o %s.eps %s' \
395 # check if it really is EPS.
396 # Otherwise music glyphs disappear from 2nd and following pages.
398 # TODO: should run dvips -pp -E per page, then we get proper
401 f = open ('%s.eps' % file)
402 for x in range(0,10) :
403 if re.search ("^%%Pages: ", f.readline ()):
406 ly.system ('dvips -Ppdf -u+lilypond.map -o %s.eps %s' \
411 def find_file (name):
412 for i in include_path:
413 full = os.path.join (i, name)
414 if os.path.exists (full):
416 ly.error (_ ('file not found: %s\n' % name))
420 def verbatim_html (s):
421 return re.sub ('>', '>',
423 re.sub ('&', '&', s)))
425 def verbatim_texinfo (s):
426 return re.sub ('{', '@{',
428 re.sub ('@', '@@', s)))
430 def split_options (option_string):
431 return re.split (format_res[format]['option-sep'], option_string)
435 def replacement_text (self):
438 def filter_text (self):
439 return self.replacement_text ()
442 def is_outdated (self):
445 class Substring (Chunk):
446 def __init__ (self, source, start, end):
451 def replacement_text (self):
452 return self.source [self.start:self.end]
454 class Snippet (Chunk):
455 def __init__ (self, type, match, format):
462 def replacement_text (self):
463 return self.match.group (0)
465 def substring (self, s):
466 return self.match.group (s)
469 return `self.__class__` + " type = " + self.type
471 class Include_snippet (Snippet):
472 def processed_filename (self):
473 f = self.substring ('filename')
474 return os.path.splitext (f)[0] + format2ext[format]
476 def replacement_text (self):
477 s = self.match.group (0)
478 f = self.substring ('filename')
480 return re.sub (f, self.processed_filename (), s)
482 class Lilypond_snippet (Snippet):
483 def __init__ (self, type, match, format):
484 Snippet.__init__ (self, type, match, format)
485 os = match.group ('options')
487 self.options = split_options (os)
490 return self.substring ('code')
495 return compose_ly (s, self.options)
500 self.hash = abs (hash (self.full_ly ()))
505 return 'lily-%d' % self.get_hash ()
509 outf = open (self.basename () + '.ly', 'w')
510 outf.write (self.full_ly ())
512 def is_outdated (self):
513 base = self.basename ()
515 found = os.path.exists (base + '.ly') and \
516 os.path.exists (base + '.tex')
518 if format == HTML or format == TEXINFO:
519 found = found and (os.path.exists (base + '.png')
520 or glob.glob (base + '-page*.png'))
522 if found and (use_hash_p \
523 or self.ly () == open (base + '.ly').read ()):
524 # TODO: something smart with target formats
525 # (ps, png) and m/ctimes
529 def filter_text (self):
530 code = self.substring ('code')
531 s = run_filter (code)
533 'options': self.match.group ('options')
536 return output[self.format][FILTER] % d
538 def replacement_text (self):
539 func = Lilypond_snippet.__dict__ ['output_' + self.format]
542 def get_images (self):
543 base = self.basename ()
545 single = '%(base)s.png' % vars ()
546 multiple = '%(base)s-page1.png' % vars ()
548 if os.path.exists (multiple) \
549 and (not os.path.exists (single)\
550 or (os.stat (multiple)[stat.ST_MTIME] \
551 > os.stat (single)[stat.ST_MTIME])):
552 images = glob.glob ('%(base)s-page*.png' % vars ())
555 def output_html (self):
557 base = self.basename ()
559 str += self.output_print_filename (HTML)
560 if VERBATIM in self.options:
561 verb = verbatim_html (self.substring ('code'))
562 str += write (output[HTML][VERBATIM] % vars ())
564 str += output[HTML][BEFORE] % vars ()
565 for image in self.get_images ():
566 base, ext = os.path.splitext (image)
567 str += output[HTML][OUTPUT] % vars ()
568 str += output[HTML][AFTER] % vars ()
571 def output_info (self):
572 str = self.output_print_filename (HTML)
573 str = output[TEXINFO][BEFORE] % vars ()
574 for image in self.get_images ():
575 base, ext = os.path.splitext (image)
576 # URG, makeinfo implicitely prepends dot to ext
577 # specifying no extension is most robust
579 str += output[TEXINFO][OUTPUT] % vars ()
580 str += output[TEXINFO][AFTER] % vars ()
583 def output_latex (self):
585 base = self.basename ()
587 str += self.output_print_filename (LATEX)
588 if VERBATIM in self.options:
589 verb = self.substring ('code')
590 str += (output[LATEX][VERBATIM] % vars ())
591 str += (output[LATEX][BEFORE]
592 + (output[LATEX][OUTPUT] % vars ())
593 + output[LATEX][AFTER])
596 def output_print_filename (self,format):
598 if PRINTFILENAME in self.options:
599 base = self.basename ()
600 filename = self.substring ('filename')
601 str = output[format][PRINTFILENAME] % vars ()
604 def output_texinfo (self):
606 # self.output_print_filename (TEXINFO)
607 str += ('@html\n' + self.output_print_filename (HTML)
609 str += ('@tex\n' + self.output_print_filename (LATEX)
611 base = self.basename ()
612 if TEXIDOC in self.options:
613 texidoc = base + '.texidoc'
614 if os.path.exists (texidoc):
615 str += '@include %(texidoc)s\n' % vars ()
617 if VERBATIM in self.options:
618 verb = verbatim_texinfo (self.substring ('code'))
619 str += (output[TEXINFO][VERBATIM] % vars ())
621 str += ('@ifinfo\n' + self.output_info () + '\n@end ifinfo\n')
622 str += ('@tex\n' + self.output_latex () + '\n@end tex\n')
623 str += ('@html\n' + self.output_html () + '\n@end html\n')
624 # need par after image
629 class Lilypond_file_snippet (Lilypond_snippet):
631 name = self.substring ('filename')
632 return '\\renameinput \"%s\"\n' % name\
633 + open (find_file (name)).read ()
636 snippet_type_to_class = {
637 'lilypond_file' : Lilypond_file_snippet,
638 'lilypond_block' : Lilypond_snippet,
639 'lilypond' : Lilypond_snippet,
640 'include' : Include_snippet,
643 def find_toplevel_snippets (s, types):
646 res[i] = ly.re.compile (snippet_res[format][i])
650 ## found = dict (map (lambda x: (x, None), types))
653 map (lambda x, f=found: f.setdefault (x, None), types)
655 # We want to search for multiple regexes, without searching
656 # the string multiple times for one regex.
657 # Hence, we use earlier results to limit the string portion
659 # Since every part of the string is traversed at most once for
660 # every type of snippet, this is linear.
666 if not found[type] or found[type][0] < index:
668 m = res[type].search (s[index:endex])
673 if snippet_type_to_class.has_key (type):
674 cl = snippet_type_to_class[type]
675 snip = cl (type, m, format)
676 start = index + m.start (0)
677 found[type] = (start, snip)
680 and (not first or found[type][0] < found[first][0]):
685 # Limiting the search space is a cute
686 # idea, but this *requires* to search
687 # for possible containing blocks
688 # first, at least long as we do not
689 # search for the start of blocks, but
690 # always/directly for the entire
691 # @block ... @end block.
693 endex = found[first][0]
696 snippets.append (Substring (s, index, len (s)))
699 (start , snip) = found[first]
700 snippets.append (Substring (s, index, start))
701 snippets.append (snip)
703 index = start + len (snip.match.group (0))
707 def filter_pipe (input, cmd):
709 ly.progress (_ ("Opening filter `%s\'") % cmd)
711 stdin, stdout, stderr = os.popen3 (cmd)
713 status = stdin.close ()
717 output = stdout.read ()
718 status = stdout.close ()
719 error = stderr.read ()
723 signal = 0x0f & status
724 if status or (not output and error):
725 exit_status = status >> 8
726 ly.error (_ ("`%s\' failed (%d)") % (cmd, exit_status))
727 ly.error (_ ("The error log is as follows:"))
728 sys.stderr.write (error)
729 sys.stderr.write (stderr.read ())
738 return filter_pipe (s, filter_cmd)
740 def is_derived_class (cl, baseclass):
743 for b in cl.__bases__:
744 if is_derived_class (b, baseclass):
749 def process_snippets (cmd, snippets):
750 names = filter (lambda x: x, map (Lilypond_snippet.basename, snippets))
752 ly.system (string.join ([cmd] + names))
754 if format == HTML or format == TEXINFO:
756 if os.path.exists (i + '.tex'):
758 ly.make_ps_images (i + '.eps', resolution=110)
760 LATEX_DOCUMENT = r'''
763 \typeout{textwidth=\the\textwidth}
764 \typeout{columnsep=\the\columnsep}
765 \makeatletter\if@twocolumn\typeout{columns=2}\fi\makeatother
768 #need anything else besides textwidth?
769 def get_latex_textwidth (source):
770 m = re.search (r'''(?P<preamble>\\begin\s*{document})''', source)
771 preamble = source[:m.start (0)]
772 latex_document = LATEX_DOCUMENT % vars ()
773 parameter_string = filter_pipe (latex_document, latex_filter_cmd)
776 m = re.search ('columns=([0-9.]*)', parameter_string)
778 columns = string.atoi (m.group (1))
781 m = re.search ('columnsep=([0-9.]*)pt', parameter_string)
783 columnsep = string.atof (m.group (1))
786 m = re.search('textwidth=([0-9.]*)pt', parameter_string)
788 textwidth = string.atof (m.group (1))
790 textwidth = (textwidth - columnsep) / columns
801 '.texinfo' : TEXINFO,
807 #TEXINFO: '.texinfo',
812 def do_file (input_filename):
816 e = os.path.splitext (input_filename)[1]
817 if e in ext2format.keys ():
819 format = ext2format[e]
821 ly.error (_ ("cannot determine format for: %s" \
824 if not input_filename or input_filename == '-':
825 in_handle = sys.stdin
826 input_fullname = '<stdin>'
828 if os.path.exists (input_filename):
829 input_fullname = input_filename
830 elif format == LATEX:
831 # urg python interface to libkpathsea?
832 input_fullname = ly.read_pipe ('kpsewhich '
833 + input_filename)[:-1]
835 input_fullname = find_file (input_filename)
836 in_handle = open (input_fullname)
838 if input_filename == '-':
841 input_base = os.path.basename \
842 (os.path.splitext (input_filename)[0])
844 # only default to stdout when filtering
845 if output_name == '-' or (not output_name and filter_cmd):
846 output_filename = '-'
847 output_file = sys.stdout
850 output_filename = input_base + format2ext[format]
852 if not os.path.isdir (output_name):
853 os.mkdir (output_name, 0777)
854 output_filename = (output_name
856 + format2ext[format])
859 if (os.path.exists (input_filename) and
860 os.path.exists (output_filename) and
861 os.path.samefile (output_filename, input_fullname)):
862 ly.error (_("Output would overwrite input file; use --output."))
865 output_file = open (output_filename, 'w')
867 os.chdir (output_name)
869 ly.progress (_ ("Reading %s...") % input_fullname)
870 source = in_handle.read ()
873 # FIXME: containing blocks must be first, see find_toplevel_snippets
879 'singleline_comment',
883 ly.progress (_ ("Dissecting..."))
884 chunks = find_toplevel_snippets (source, snippet_types)
887 global default_ly_options
889 if LINEWIDTH not in default_ly_options.keys ():
891 textwidth = get_latex_textwidth (source)
892 default_ly_options[LINEWIDTH] = '''%.0f\\pt''' \
894 elif format == TEXINFO:
895 for (k, v) in texinfo_linewidths.items ():
896 # FIXME: @paper is usually not in chunk #0:
897 # \input texinfo @c -*-texinfo-*-
898 # bluntly search first K of source
899 # s = chunks[0].replacement_text ()
900 if re.search (k, source[:1024]):
901 default_ly_options[LINEWIDTH] = v
905 output_file.writelines ([c.filter_text () for c in chunks])
909 outdated = filter (lambda x: is_derived_class (x.__class__, Lilypond_snippet) \
910 and x.is_outdated (), chunks)
911 ly.progress (_ ("Writing snippets..."))
912 map (Lilypond_snippet.write_ly, outdated)
916 ly.progress (_ ("Processing..."))
917 process_snippets (process_cmd, outdated)
919 ly.progress (_ ("All snippets are up to date..."))
922 ly.progress (_ ("Compiling %s...") % output_filename)
923 output_file.writelines ([s.replacement_text () \
927 def process_include (snippet):
928 os.chdir (original_dir)
929 name = snippet.substring ('filename')
930 ly.progress (_ ('Processing include: %s') % name)
934 map (process_include,
935 filter (lambda x: is_derived_class (x.__class__, Include_snippet), chunks))
938 global format, output_name
939 global filter_cmd, process_cmd, verbose_p
941 (sh, long) = ly.getopt_args (option_definitions)
943 (options, files) = getopt.getopt (sys.argv[1:], sh, long)
944 except getopt.error, s:
945 sys.stderr.write ('\n')
946 ly.error (_ ("getopt says: `%s\'" % s))
947 sys.stderr.write ('\n')
957 elif o == '--filter' or o == '-F':
960 elif o == '--format' or o == '-f':
962 if a == 'texi-html' or a == 'texi':
964 elif o == '--help' or o == '-h':
967 elif o == '--include' or o == '-I':
968 include_path.append (os.path.join (original_dir,
970 elif o == '--output' or o == '-o':
972 elif o == '--outdir':
974 elif o == '--process' or o == '-P':
977 elif o == '--version' or o == '-v':
978 ly.identify (sys.stdout)
980 elif o == '--verbose' or o == '-V':
982 elif o == '--warranty' or o == '-w':
989 files = do_options ()
992 process_cmd += string.join ([(' -I %s' % p)
993 for p in include_path])
995 ly.identify (sys.stderr)
996 ly.setup_environment ()
1000 if __name__ == '__main__':