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 require = ['.ly', '.tex']
517 require.append ('.png')
518 require = [os.path.exists (base + x) for x in require]
519 if reduce (lambda a,b: a and b, require) \
521 or self.ly () == open (base + '.ly').read ()):
522 # TODO: something smart with target formats
523 # (ps, png) and m/ctimes
527 def filter_text (self):
528 code = self.substring ('code')
529 s = run_filter (code)
531 'options': self.match.group ('options')
534 return output[self.format][FILTER] % d
536 def replacement_text (self):
537 func = Lilypond_snippet.__dict__ ['output_' + self.format]
540 def get_images (self):
541 base = self.basename ()
543 single = '%(base)s.png' % vars ()
544 multiple = '%(base)s-page1.png' % vars ()
546 if os.path.exists (multiple) \
547 and (not os.path.exists (single)\
548 or (os.stat (multiple)[stat.ST_MTIME] \
549 > os.stat (single)[stat.ST_MTIME])):
550 images = glob.glob ('%(base)s-page*.png' % vars ())
553 def output_html (self):
555 base = self.basename ()
557 str += self.output_print_filename (HTML)
558 if VERBATIM in self.options:
559 verb = verbatim_html (self.substring ('code'))
560 str += write (output[HTML][VERBATIM] % vars ())
562 str += output[HTML][BEFORE] % vars ()
563 for image in self.get_images ():
564 base, ext = os.path.splitext (image)
565 str += output[HTML][OUTPUT] % vars ()
566 str += output[HTML][AFTER] % vars ()
569 def output_info (self):
570 str = self.output_print_filename (HTML)
571 str = output[TEXINFO][BEFORE] % vars ()
572 for image in self.get_images ():
573 base, ext = os.path.splitext (image)
574 # URG, makeinfo implicitely prepends dot to ext
575 # specifying no extension is most robust
577 str += output[TEXINFO][OUTPUT] % vars ()
578 str += output[TEXINFO][AFTER] % vars ()
581 def output_latex (self):
583 base = self.basename ()
585 str += self.output_print_filename (LATEX)
586 if VERBATIM in self.options:
587 verb = self.substring ('code')
588 str += (output[LATEX][VERBATIM] % vars ())
589 str += (output[LATEX][BEFORE]
590 + (output[LATEX][OUTPUT] % vars ())
591 + output[LATEX][AFTER])
594 def output_print_filename (self,format):
596 if PRINTFILENAME in self.options:
597 base = self.basename ()
598 filename = self.substring ('filename')
599 str = output[format][PRINTFILENAME] % vars ()
602 def output_texinfo (self):
604 # self.output_print_filename (TEXINFO)
605 str += ('@html\n' + self.output_print_filename (HTML)
607 str += ('@tex\n' + self.output_print_filename (LATEX)
609 base = self.basename ()
610 if TEXIDOC in self.options:
611 texidoc = base + '.texidoc'
612 if os.path.exists (texidoc):
613 str += '@include %(texidoc)s\n' % vars ()
615 if VERBATIM in self.options:
616 verb = verbatim_texinfo (self.substring ('code'))
617 str += (output[TEXINFO][VERBATIM] % vars ())
619 str += ('@ifinfo\n' + self.output_info () + '\n@end ifinfo\n')
620 str += ('@tex\n' + self.output_latex () + '\n@end tex\n')
621 str += ('@html\n' + self.output_html () + '\n@end html\n')
622 # need par after image
627 class Lilypond_file_snippet (Lilypond_snippet):
629 name = self.substring ('filename')
630 return '\\renameinput \"%s\"\n' % name\
631 + open (find_file (name)).read ()
634 snippet_type_to_class = {
635 'lilypond_file' : Lilypond_file_snippet,
636 'lilypond_block' : Lilypond_snippet,
637 'lilypond' : Lilypond_snippet,
638 'include' : Include_snippet,
641 def find_toplevel_snippets (s, types):
644 res[i] = ly.re.compile (snippet_res[format][i])
648 ## found = dict (map (lambda x: (x, None), types))
651 map (lambda x, f=found: f.setdefault (x, None), types)
653 # We want to search for multiple regexes, without searching
654 # the string multiple times for one regex.
655 # Hence, we use earlier results to limit the string portion
657 # Since every part of the string is traversed at most once for
658 # every type of snippet, this is linear.
664 if not found[type] or found[type][0] < index:
666 m = res[type].search (s[index:endex])
671 if snippet_type_to_class.has_key (type):
672 cl = snippet_type_to_class[type]
673 snip = cl (type, m, format)
674 start = index + m.start (0)
675 found[type] = (start, snip)
678 and (not first or found[type][0] < found[first][0]):
683 # Limiting the search space is a cute
684 # idea, but this *requires* to search
685 # for possible containing blocks
686 # first, at least long as we do not
687 # search for the start of blocks, but
688 # always/directly for the entire
689 # @block ... @end block.
691 endex = found[first][0]
694 snippets.append (Substring (s, index, len (s)))
697 (start , snip) = found[first]
698 snippets.append (Substring (s, index, start))
699 snippets.append (snip)
701 index = start + len (snip.match.group (0))
705 def filter_pipe (input, cmd):
707 ly.progress (_ ("Opening filter `%s\'") % cmd)
709 stdin, stdout, stderr = os.popen3 (cmd)
711 status = stdin.close ()
715 output = stdout.read ()
716 status = stdout.close ()
717 error = stderr.read ()
721 signal = 0x0f & status
722 if status or (not output and error):
723 exit_status = status >> 8
724 ly.error (_ ("`%s\' failed (%d)") % (cmd, exit_status))
725 ly.error (_ ("The error log is as follows:"))
726 sys.stderr.write (error)
727 sys.stderr.write (stderr.read ())
736 return filter_pipe (s, filter_cmd)
738 def is_derived_class (cl, baseclass):
741 for b in cl.__bases__:
742 if is_derived_class (b, baseclass):
747 def process_snippets (cmd, snippets):
748 names = filter (lambda x: x, map (Lilypond_snippet.basename, snippets))
750 ly.system (string.join ([cmd] + names))
752 if format == HTML or format == TEXINFO:
754 if os.path.exists (i + '.tex'):
756 ly.make_ps_images (i + '.eps', resolution=110)
758 LATEX_DOCUMENT = r'''
761 \typeout{textwidth=\the\textwidth}
762 \typeout{columnsep=\the\columnsep}
763 \makeatletter\if@twocolumn\typeout{columns=2}\fi\makeatother
766 #need anything else besides textwidth?
767 def get_latex_textwidth (source):
768 m = re.search (r'''(?P<preamble>\\begin\s*{document})''', source)
769 preamble = source[:m.start (0)]
770 latex_document = LATEX_DOCUMENT % vars ()
771 parameter_string = filter_pipe (latex_document, latex_filter_cmd)
774 m = re.search ('columns=([0-9.]*)', parameter_string)
776 columns = string.atoi (m.group (1))
779 m = re.search ('columnsep=([0-9.]*)pt', parameter_string)
781 columnsep = string.atof (m.group (1))
784 m = re.search('textwidth=([0-9.]*)pt', parameter_string)
786 textwidth = string.atof (m.group (1))
788 textwidth = (textwidth - columnsep) / columns
799 '.texinfo' : TEXINFO,
805 #TEXINFO: '.texinfo',
810 def do_file (input_filename):
814 e = os.path.splitext (input_filename)[1]
815 if e in ext2format.keys ():
817 format = ext2format[e]
819 ly.error (_ ("cannot determine format for: %s" \
822 if not input_filename or input_filename == '-':
823 in_handle = sys.stdin
824 input_fullname = '<stdin>'
826 if os.path.exists (input_filename):
827 input_fullname = input_filename
828 elif format == LATEX:
829 # urg python interface to libkpathsea?
830 input_fullname = ly.read_pipe ('kpsewhich '
831 + input_filename)[:-1]
833 input_fullname = find_file (input_filename)
834 in_handle = open (input_fullname)
836 if input_filename == '-':
839 input_base = os.path.basename \
840 (os.path.splitext (input_filename)[0])
842 # only default to stdout when filtering
843 if output_name == '-' or (not output_name and filter_cmd):
844 output_filename = '-'
845 output_file = sys.stdout
848 output_filename = input_base + format2ext[format]
850 if not os.path.isdir (output_name):
851 os.mkdir (output_name, 0777)
852 output_filename = (output_name
854 + format2ext[format])
857 if (os.path.exists (input_filename) and
858 os.path.exists (output_filename) and
859 os.path.samefile (output_filename, input_fullname)):
860 ly.error (_("Output would overwrite input file; use --output."))
863 output_file = open (output_filename, 'w')
865 os.chdir (output_name)
867 ly.progress (_ ("Reading %s...") % input_fullname)
868 source = in_handle.read ()
871 # FIXME: containing blocks must be first, see find_toplevel_snippets
877 'singleline_comment',
881 ly.progress (_ ("Dissecting..."))
882 chunks = find_toplevel_snippets (source, snippet_types)
885 global default_ly_options
887 if LINEWIDTH not in default_ly_options.keys ():
889 textwidth = get_latex_textwidth (source)
890 default_ly_options[LINEWIDTH] = '''%.0f\\pt''' \
892 elif format == TEXINFO:
893 for (k, v) in texinfo_linewidths.items ():
894 # FIXME: @paper is usually not in chunk #0:
895 # \input texinfo @c -*-texinfo-*-
896 # bluntly search first K of source
897 # s = chunks[0].replacement_text ()
898 if re.search (k, source[:1024]):
899 default_ly_options[LINEWIDTH] = v
903 output_file.writelines ([c.filter_text () for c in chunks])
907 outdated = filter (lambda x: is_derived_class (x.__class__, Lilypond_snippet) \
908 and x.is_outdated (), chunks)
909 ly.progress (_ ("Writing snippets..."))
910 map (Lilypond_snippet.write_ly, outdated)
914 ly.progress (_ ("Processing..."))
915 process_snippets (process_cmd, outdated)
917 ly.progress (_ ("All snippets are up to date..."))
920 ly.progress (_ ("Compiling %s...") % output_filename)
921 output_file.writelines ([s.replacement_text () \
925 def process_include (snippet):
926 os.chdir (original_dir)
927 name = snippet.substring ('filename')
928 ly.progress (_ ('Processing include: %s') % name)
932 map (process_include,
933 filter (lambda x: is_derived_class (x.__class__, Include_snippet), chunks))
936 global format, output_name
937 global filter_cmd, process_cmd, verbose_p
939 (sh, long) = ly.getopt_args (option_definitions)
941 (options, files) = getopt.getopt (sys.argv[1:], sh, long)
942 except getopt.error, s:
943 sys.stderr.write ('\n')
944 ly.error (_ ("getopt says: `%s\'" % s))
945 sys.stderr.write ('\n')
955 elif o == '--filter' or o == '-F':
958 elif o == '--format' or o == '-f':
960 if a == 'texi-html' or a == 'texi':
962 elif o == '--help' or o == '-h':
965 elif o == '--include' or o == '-I':
966 include_path.append (os.path.join (original_dir,
968 elif o == '--output' or o == '-o':
970 elif o == '--outdir':
972 elif o == '--process' or o == '-P':
975 elif o == '--version' or o == '-v':
976 ly.identify (sys.stdout)
978 elif o == '--verbose' or o == '-V':
980 elif o == '--warranty' or o == '-w':
987 files = do_options ()
990 process_cmd += string.join ([(' -I %s' % p)
991 for p in include_path])
993 ly.identify (sys.stderr)
994 ly.setup_environment ()
998 if __name__ == '__main__':