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'''\noindent
249 %(verb)s\end{verbatim}
251 FILTER: r'''\begin{lilypond}[%(options)s]
257 FILTER: r'''@lilypond[%(options)s]
262 OUTPUT: r'''@noindent
263 @image{%(base)s,,,[image of music],%(ext)s}
265 PRINTFILENAME: '''@file{%(filename)s}
268 VERBATIM: r'''@exampleindent 0
276 PREAMBLE_LY = r'''%% Generated by %(program_name)s
277 %% Options: [%(option_string)s]
279 \paper {%(paper_string)s
283 FRAGMENT_LY = r'''\score{
284 \notes%(notes_string)s{
289 texinfo_linewidths = {
290 '@afourpaper': '160 \\mm',
291 '@afourwide': '6.5 \\in',
292 '@afourlatex': '150 \\mm',
293 '@smallbook': '5 \\in' ,
294 '@letterpaper': '6\\in',
297 def classic_lilypond_book_compatibility (o):
298 if o == 'singleline':
300 m = re.search ('relative\s*([-0-9])', o)
302 return 'relative=%s' % m.group (1)
303 m = re.match ('([0-9]+)pt', o)
305 return 'staffsize=%s' % m.group (1)
306 m = re.match ('indent=([-.0-9]+)(cm|in|mm|pt)', o)
308 f = float (m.group (1))
309 return 'indent=%f\\%s' % (f, m.group (2))
310 m = re.match ('linewidth=([-.0-9]+)(cm|in|mm|pt)', o)
312 f = float (m.group (1))
313 return 'linewidth=%f\\%s' % (f, m.group (2))
316 def compose_ly (code, options):
318 for i in default_ly_options.keys ():
322 m = re.search (r'''\\score''', code)
323 if not m and (not options \
324 or not NOFRAGMENT in options or FRAGMENT in options):
325 if RAGGEDRIGHT not in options:
326 options.append (RAGGEDRIGHT)
335 override.update (default_ly_options)
337 option_string = string.join (options, ',')
340 preamble_options = []
342 c = classic_lilypond_book_compatibility (i)
344 ly.warning (_ ("deprecated ly-option used: %s" % i))
345 ly.warning (_ ("compatibility mode translation: %s" \
349 if string.find (i, '=') > 0:
350 key, value = string.split (i, '=')
351 override[key] = value
354 if i not in override.keys ():
357 if key in ly_options[NOTES].keys ():
358 notes_options.append (ly_options[NOTES][key])
359 elif key in ly_options[PREAMBLE].keys ():
360 preamble_options.append (ly_options[PREAMBLE][key])
361 elif key in ly_options[PAPER].keys ():
362 paper_options.append (ly_options[PAPER][key])
363 elif key not in (FRAGMENT, NOFRAGMENT, PRINTFILENAME,
364 RELATIVE, VERBATIM, TEXIDOC):
365 ly.warning (_("ignoring unknown ly option: %s") % i)
368 if RELATIVE in override.keys () and override[RELATIVE]:
369 relative = string.atoi (override[RELATIVE])
375 relative_quotes += ',' * (- relative)
377 relative_quotes += "'" * relative
379 program_name = __main__.program_name
380 paper_string = string.join (paper_options, '\n ') % override
381 preamble_string = string.join (preamble_options, '\n ') % override
382 notes_string = string.join (notes_options, '\n ') % vars ()
383 return (PREAMBLE_LY + body) % vars ()
386 # use lilypond-bin for latex (.lytex) books,
387 # and lilypond --preview for html, texinfo books?
389 cmd = r'latex "\nonstopmode \input %s"' % file
390 # Ugh. (La)TeX writes progress and error messages on stdout
392 cmd = '(( %s >&2 ) >&- )' % cmd
394 ly.system ('dvips -Ppdf -u+lilypond.map -E -o %s.eps %s' \
398 # check if it really is EPS.
399 # Otherwise music glyphs disappear from 2nd and following pages.
401 # TODO: should run dvips -pp -E per page, then we get proper
404 f = open ('%s.eps' % file)
405 for x in range(0,10) :
406 if re.search ("^%%Pages: ", f.readline ()):
409 ly.system ('dvips -Ppdf -u+lilypond.map -o %s.eps %s' \
414 def find_file (name):
415 for i in include_path:
416 full = os.path.join (i, name)
417 if os.path.exists (full):
419 ly.error (_ ('file not found: %s\n' % name))
423 def verbatim_html (s):
424 return re.sub ('>', '>',
426 re.sub ('&', '&', s)))
428 def verbatim_texinfo (s):
429 return re.sub ('{', '@{',
431 re.sub ('@', '@@', s)))
433 def split_options (option_string):
434 return re.split (format_res[format]['option-sep'], option_string)
438 def replacement_text (self):
441 def filter_text (self):
442 return self.replacement_text ()
445 def is_outdated (self):
448 class Substring (Chunk):
449 def __init__ (self, source, start, end):
454 def replacement_text (self):
455 return self.source [self.start:self.end]
457 class Snippet (Chunk):
458 def __init__ (self, type, match, format):
465 def replacement_text (self):
466 return self.match.group (0)
468 def substring (self, s):
469 return self.match.group (s)
472 return `self.__class__` + " type = " + self.type
474 class Include_snippet (Snippet):
475 def processed_filename (self):
476 f = self.substring ('filename')
477 return os.path.splitext (f)[0] + format2ext[format]
479 def replacement_text (self):
480 s = self.match.group (0)
481 f = self.substring ('filename')
483 return re.sub (f, self.processed_filename (), s)
485 class Lilypond_snippet (Snippet):
486 def __init__ (self, type, match, format):
487 Snippet.__init__ (self, type, match, format)
488 os = match.group ('options')
490 self.options = split_options (os)
493 return self.substring ('code')
498 return compose_ly (s, self.options)
503 self.hash = abs (hash (self.full_ly ()))
508 return 'lily-%d' % self.get_hash ()
512 outf = open (self.basename () + '.ly', 'w')
513 outf.write (self.full_ly ())
515 def is_outdated (self):
516 base = self.basename ()
518 found = os.path.exists (base + '.ly') and \
519 os.path.exists (base + '.tex')
521 if format == HTML or format == TEXINFO:
522 found = found and (os.path.exists (base + '.png')
523 or glob.glob (base + '-page*.png'))
525 if found and (use_hash_p \
526 or self.ly () == open (base + '.ly').read ()):
527 # TODO: something smart with target formats
528 # (ps, png) and m/ctimes
532 def filter_text (self):
533 code = self.substring ('code')
534 s = run_filter (code)
536 'options': self.match.group ('options')
539 return output[self.format][FILTER] % d
541 def replacement_text (self):
542 func = Lilypond_snippet.__dict__ ['output_' + self.format]
545 def get_images (self):
546 base = self.basename ()
548 single = '%(base)s.png' % vars ()
549 multiple = '%(base)s-page1.png' % vars ()
551 if os.path.exists (multiple) \
552 and (not os.path.exists (single)\
553 or (os.stat (multiple)[stat.ST_MTIME] \
554 > os.stat (single)[stat.ST_MTIME])):
555 images = glob.glob ('%(base)s-page*.png' % vars ())
558 def output_html (self):
560 base = self.basename ()
562 str += self.output_print_filename (HTML)
563 if VERBATIM in self.options:
564 verb = verbatim_html (self.substring ('code'))
565 str += write (output[HTML][VERBATIM] % vars ())
567 str += output[HTML][BEFORE] % vars ()
568 for image in self.get_images ():
569 base, ext = os.path.splitext (image)
570 str += output[HTML][OUTPUT] % vars ()
571 str += output[HTML][AFTER] % vars ()
574 def output_info (self):
575 str = self.output_print_filename (HTML)
576 str = output[TEXINFO][BEFORE] % vars ()
577 for image in self.get_images ():
578 base, ext = os.path.splitext (image)
579 # URG, makeinfo implicitely prepends dot to ext
580 # specifying no extension is most robust
582 str += output[TEXINFO][OUTPUT] % vars ()
583 str += output[TEXINFO][AFTER] % vars ()
586 def output_latex (self):
588 base = self.basename ()
590 str += self.output_print_filename (LATEX)
591 if VERBATIM in self.options:
592 verb = self.substring ('code')
593 str += (output[LATEX][VERBATIM] % vars ())
594 str += (output[LATEX][BEFORE]
595 + (output[LATEX][OUTPUT] % vars ())
596 + output[LATEX][AFTER])
599 def output_print_filename (self,format):
601 if PRINTFILENAME in self.options:
602 base = self.basename ()
603 filename = self.substring ('filename')
604 str = output[format][PRINTFILENAME] % vars ()
607 def output_texinfo (self):
609 # self.output_print_filename (TEXINFO)
610 str += ('@html\n' + self.output_print_filename (HTML)
612 str += ('@tex\n' + self.output_print_filename (LATEX)
614 base = self.basename ()
615 if TEXIDOC in self.options:
616 texidoc = base + '.texidoc'
617 if os.path.exists (texidoc):
618 str += '@include %(texidoc)s\n' % vars ()
620 if VERBATIM in self.options:
621 verb = verbatim_texinfo (self.substring ('code'))
622 str += (output[TEXINFO][VERBATIM] % vars ())
624 str += ('@ifinfo\n' + self.output_info () + '\n@end ifinfo\n')
625 str += ('@tex\n' + self.output_latex () + '\n@end tex\n')
626 str += ('@html\n' + self.output_html () + '\n@end html\n')
627 # need par after image
632 class Lilypond_file_snippet (Lilypond_snippet):
634 name = self.substring ('filename')
635 return '\\renameinput \"%s\"\n' % name\
636 + open (find_file (name)).read ()
639 snippet_type_to_class = {
640 'lilypond_file' : Lilypond_file_snippet,
641 'lilypond_block' : Lilypond_snippet,
642 'lilypond' : Lilypond_snippet,
643 'include' : Include_snippet,
646 def find_toplevel_snippets (s, types):
649 res[i] = ly.re.compile (snippet_res[format][i])
653 ## found = dict (map (lambda x: (x, None), types))
656 map (lambda x, f=found: f.setdefault (x, None), types)
658 # We want to search for multiple regexes, without searching
659 # the string multiple times for one regex.
660 # Hence, we use earlier results to limit the string portion
662 # Since every part of the string is traversed at most once for
663 # every type of snippet, this is linear.
669 if not found[type] or found[type][0] < index:
671 m = res[type].search (s[index:endex])
676 if snippet_type_to_class.has_key (type):
677 cl = snippet_type_to_class[type]
678 snip = cl (type, m, format)
679 start = index + m.start (0)
680 found[type] = (start, snip)
683 and (not first or found[type][0] < found[first][0]):
688 # Limiting the search space is a cute
689 # idea, but this *requires* to search
690 # for possible containing blocks
691 # first, at least long as we do not
692 # search for the start of blocks, but
693 # always/directly for the entire
694 # @block ... @end block.
696 endex = found[first][0]
699 snippets.append (Substring (s, index, len (s)))
702 (start , snip) = found[first]
703 snippets.append (Substring (s, index, start))
704 snippets.append (snip)
706 index = start + len (snip.match.group (0))
710 def filter_pipe (input, cmd):
712 ly.progress (_ ("Opening filter `%s\'") % cmd)
714 stdin, stdout, stderr = os.popen3 (cmd)
716 status = stdin.close ()
720 output = stdout.read ()
721 status = stdout.close ()
722 error = stderr.read ()
726 signal = 0x0f & status
727 if status or (not output and error):
728 exit_status = status >> 8
729 ly.error (_ ("`%s\' failed (%d)") % (cmd, exit_status))
730 ly.error (_ ("The error log is as follows:"))
731 sys.stderr.write (error)
732 sys.stderr.write (stderr.read ())
741 return filter_pipe (s, filter_cmd)
743 def is_derived_class (cl, baseclass):
746 for b in cl.__bases__:
747 if is_derived_class (b, baseclass):
752 def process_snippets (cmd, snippets):
753 names = filter (lambda x: x, map (Lilypond_snippet.basename, snippets))
755 ly.system (string.join ([cmd] + names))
757 if format == HTML or format == TEXINFO:
759 if os.path.exists (i + '.tex'):
761 ly.make_ps_images (i + '.eps', resolution=110)
763 LATEX_DOCUMENT = r'''
766 \typeout{textwidth=\the\textwidth}
767 \typeout{columnsep=\the\columnsep}
768 \makeatletter\if@twocolumn\typeout{columns=2}\fi\makeatother
771 #need anything else besides textwidth?
772 def get_latex_textwidth (source):
773 m = re.search (r'''(?P<preamble>\\begin\s*{document})''', source)
774 preamble = source[:m.start (0)]
775 latex_document = LATEX_DOCUMENT % vars ()
776 parameter_string = filter_pipe (latex_document, latex_filter_cmd)
779 m = re.search ('columns=([0-9.]*)', parameter_string)
781 columns = string.atoi (m.group (1))
784 m = re.search ('columnsep=([0-9.]*)pt', parameter_string)
786 columnsep = string.atof (m.group (1))
789 m = re.search('textwidth=([0-9.]*)pt', parameter_string)
791 textwidth = string.atof (m.group (1))
793 textwidth = (textwidth - columnsep) / columns
804 '.texinfo' : TEXINFO,
810 #TEXINFO: '.texinfo',
815 def do_file (input_filename):
819 e = os.path.splitext (input_filename)[1]
820 if e in ext2format.keys ():
822 format = ext2format[e]
824 ly.error (_ ("cannot determine format for: %s" \
827 if not input_filename or input_filename == '-':
828 in_handle = sys.stdin
829 input_fullname = '<stdin>'
831 if os.path.exists (input_filename):
832 input_fullname = input_filename
833 elif format == LATEX:
834 # urg python interface to libkpathsea?
835 input_fullname = ly.read_pipe ('kpsewhich '
836 + input_filename)[:-1]
838 input_fullname = find_file (input_filename)
839 in_handle = open (input_fullname)
841 if input_filename == '-':
844 input_base = os.path.basename \
845 (os.path.splitext (input_filename)[0])
847 # only default to stdout when filtering
848 if output_name == '-' or (not output_name and filter_cmd):
849 output_filename = '-'
850 output_file = sys.stdout
853 output_filename = input_base + format2ext[format]
855 if not os.path.isdir (output_name):
856 os.mkdir (output_name, 0777)
857 output_filename = (output_name
859 + format2ext[format])
862 if (os.path.exists (input_filename) and
863 os.path.exists (output_filename) and
864 os.path.samefile (output_filename, input_fullname)):
865 ly.error (_("Output would overwrite input file; use --output."))
868 output_file = open (output_filename, 'w')
870 os.chdir (output_name)
872 ly.progress (_ ("Reading %s...") % input_fullname)
873 source = in_handle.read ()
876 # FIXME: containing blocks must be first, see find_toplevel_snippets
882 'singleline_comment',
886 ly.progress (_ ("Dissecting..."))
887 chunks = find_toplevel_snippets (source, snippet_types)
890 global default_ly_options
892 if LINEWIDTH not in default_ly_options.keys ():
894 textwidth = get_latex_textwidth (source)
895 default_ly_options[LINEWIDTH] = '''%.0f\\pt''' \
897 elif format == TEXINFO:
898 for (k, v) in texinfo_linewidths.items ():
899 # FIXME: @paper is usually not in chunk #0:
900 # \input texinfo @c -*-texinfo-*-
901 # bluntly search first K of source
902 # s = chunks[0].replacement_text ()
903 if re.search (k, source[:1024]):
904 default_ly_options[LINEWIDTH] = v
908 output_file.writelines ([c.filter_text () for c in chunks])
912 outdated = filter (lambda x: is_derived_class (x.__class__, Lilypond_snippet) \
913 and x.is_outdated (), chunks)
914 ly.progress (_ ("Writing snippets..."))
915 map (Lilypond_snippet.write_ly, outdated)
919 ly.progress (_ ("Processing..."))
920 process_snippets (process_cmd, outdated)
922 ly.progress (_ ("All snippets are up to date..."))
925 ly.progress (_ ("Compiling %s...") % output_filename)
926 output_file.writelines ([s.replacement_text () \
930 def process_include (snippet):
931 os.chdir (original_dir)
932 name = snippet.substring ('filename')
933 ly.progress (_ ('Processing include: %s') % name)
937 map (process_include,
938 filter (lambda x: is_derived_class (x.__class__, Include_snippet), chunks))
941 global format, output_name
942 global filter_cmd, process_cmd, verbose_p
944 (sh, long) = ly.getopt_args (option_definitions)
946 (options, files) = getopt.getopt (sys.argv[1:], sh, long)
947 except getopt.error, s:
948 sys.stderr.write ('\n')
949 ly.error (_ ("getopt says: `%s\'" % s))
950 sys.stderr.write ('\n')
960 elif o == '--filter' or o == '-F':
963 elif o == '--format' or o == '-f':
965 if a == 'texi-html' or a == 'texi':
967 elif o == '--help' or o == '-h':
970 elif o == '--include' or o == '-I':
971 include_path.append (os.path.join (original_dir,
973 elif o == '--output' or o == '-o':
975 elif o == '--outdir':
977 elif o == '--process' or o == '-P':
980 elif o == '--version' or o == '-v':
981 ly.identify (sys.stdout)
983 elif o == '--verbose' or o == '-V':
985 elif o == '--warranty' or o == '-w':
992 files = do_options ()
995 process_cmd += string.join ([(' -I %s' % p)
996 for p in include_path])
998 ly.identify (sys.stderr)
999 ly.setup_environment ()
1003 if __name__ == '__main__':