From: Werner Lemberg Date: Wed, 17 Nov 2004 16:41:31 +0000 (+0000) Subject: * python/lilylib.py (options_help_str): Support pretty-printing of X-Git-Tag: release/2.5.14~534 X-Git-Url: https://git.donarmstrong.com/?a=commitdiff_plain;h=8753714ec92ad880988f1f41f476a3b2e1809b8e;p=lilypond.git * 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. --- diff --git a/ChangeLog b/ChangeLog index 14076a1729..20b5c6fa18 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,11 @@ +2004-11-17 Werner Lemberg + + * 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 * Documentation/user/macros.itexi: Add comment about \command. diff --git a/python/lilylib.py b/python/lilylib.py index 61e47e7b27..0718cb64db 100644 --- a/python/lilylib.py +++ b/python/lilylib.py @@ -3,7 +3,7 @@ # # source file of the GNU LilyPond music typesetter # -# (c) 1998--2003 Han-Wen Nienhuys +# (c) 1998--2004 Han-Wen Nienhuys # Jan Nieuwenhuizen ### 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 (): diff --git a/scripts/lilypond-book.py b/scripts/lilypond-book.py index ba19a82b9d..778548d2ad 100644 --- a/scripts/lilypond-book.py +++ b/scripts/lilypond-book.py @@ -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 /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 /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 ', @@ -86,7 +79,8 @@ copyright = ('Jan Nieuwenhuizen ', 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',