]> git.donarmstrong.com Git - lilypond.git/commitdiff
* python/lilylib.py (options_help_str): Support pretty-printing of
authorWerner Lemberg <wl@gnu.org>
Wed, 17 Nov 2004 16:41:31 +0000 (16:41 +0000)
committerWerner Lemberg <wl@gnu.org>
Wed, 17 Nov 2004 16:41:31 +0000 (16:41 +0000)
newlines in fourth element of option description.

* scripts/lilypond-book.py (option_definitions): Use new lilylib
feature.

ChangeLog
python/lilylib.py
scripts/lilypond-book.py

index 14076a172936950bc32d304c48b32a95444cc75e..20b5c6fa181dd0f3916f207d58601ee6b33f7104 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,11 @@
+2004-11-17  Werner Lemberg  <wl@gnu.org>
+
+       * python/lilylib.py (options_help_str): Support pretty-printing of
+       newlines in fourth element of option description.
+
+       * scripts/lilypond-book.py (option_definitions): Use new lilylib
+       feature.
+
 2004-11-17  Jan Nieuwenhuizen  <janneke@gnu.org>
 
        * Documentation/user/macros.itexi: Add comment about \command.
index 61e47e7b27af329cf1d0e6fb4d8fce603781f0c1..0718cb64dbbafddedf01d8b55bdcc4fb0e0cdf6f 100644 (file)
@@ -3,7 +3,7 @@
 # 
 # source file of the GNU LilyPond music typesetter
 #
-# (c)  1998--200 Han-Wen Nienhuys <hanwen@cs.uu.nl>
+# (c)  1998--2004 Han-Wen Nienhuys <hanwen@cs.uu.nl>
 #                 Jan Nieuwenhuizen <janneke@gnu.org>
 
 ###  subst:\(^\|[^._a-z]\)\(abspath\|identify\|warranty\|progress\|warning\|error\|exit\|getopt_args\|option_help_str\|options_help_str\|help\|setup_temp\|read_pipe\|system\|cleanup_temp\|strip_extension\|cp_to_dir\|mkdir_p\|init\) *(
@@ -185,7 +185,15 @@ def options_help_str (opts):
 
        str = ''
        for s in strs:
-               str = str + '%s%s%s\n' % (s[0], ' ' * (w - len(s[0])  + 3), s[1])
+               first = 1
+               for ss in re.split ('\n\s*', s[1]):
+                       if first:
+                               str = str + '%s%s%s\n' \
+                                       % (s[0], ' ' * (w - len (s[0]) + 3), ss)
+                               first = 0
+                       else:
+                               str = str + '%s%s\n' \
+                                       % (' ' * (w + 3), ss)
        return str
 
 def help ():
index ba19a82b9da2d2286eef2fd8a04cfac18077fc66..778548d2addd41a8133a52ce73541a9043e7875f 100644 (file)
@@ -13,10 +13,11 @@ classic lilypond-book:
      lilypond-book --process="lilypond" BOOK.tely
 
 TODO:
-    *  ly-options: intertext ?
+    *  ly-options: intertext?
     *  --linewidth?
-    *  eps in latex / eps by lilypond -fps ?
+    *  eps in latex / eps by lilypond -fps?
     *  check latex parameters, twocolumn, multicolumn?
+    *  use --png --ps --pdf for making images?
 
     *  Converting from lilypond-book source, substitute:
        @mbinclude foo.itely -> @include foo.itely
@@ -29,20 +30,13 @@ import glob
 import stat
 import string
 
-#
-# TODO:
-#
-#  * use --png --ps --pdf for making images?
-#
-
-################################################################
 # Users of python modules should include this snippet
 # and customize variables below.
 
-# We'll suffer this path init stuff as long as we don't install our
-# python packages in <prefix>/lib/pythonx.y (and don't kludge around
-# it as we do with teTeX on Red Hat Linux: set some environment var
-# (PYTHONPATH) in profile).
+# We'll suffer this path initialization stuff as long as we don't install
+# our python packages in <prefix>/lib/pythonX.Y (and don't kludge around
+# it as we do with teTeX on Red Hat Linux: set some environment variables
+# (PYTHONPATH) in `etc/profile').
 
 # If set, LILYPONDPREFIX must take prevalence.
 # if datadir is not set, we're doing a build and LILYPONDPREFIX.
@@ -72,13 +66,12 @@ pseudo_filter_p = 0
 original_dir = os.getcwd ()
 
 help_summary = _ (
-'''Process LilyPond snippets in hybrid HTML, LaTeX or texinfo document.
+'''Process LilyPond snippets in hybrid HTML, LaTeX, or texinfo document.
 Example usage:
 
    lilypond-book --filter="tr '[a-z]' '[A-Z]'" BOOK
    lilypond-book --filter="convert-ly --no-version --from=2.0.0 -" BOOK
    lilypond-book --process='lilypond -I include' BOOK
-
 ''')
 
 copyright = ('Jan Nieuwenhuizen <janneke@gnu.org>',
@@ -86,7 +79,8 @@ copyright = ('Jan Nieuwenhuizen <janneke@gnu.org>',
 
 option_definitions = [
        (_ ("EXT"), 'f', 'format',
-         _ ("use output format EXT (texi [default], texi-html, latex, html)")),
+         _ ('''use output format EXT (texi [default], texi-html,
+               latex, html)''')),
        (_ ("FILTER"), 'F', 'filter',
          _ ("pipe snippets through FILTER [convert-ly -n -]")),
        ('', 'h', 'help',