]> git.donarmstrong.com Git - lilypond.git/commitdiff
* scripts/lilypond-book.py:
authorJan Nieuwenhuizen <janneke@gnu.org>
Mon, 4 Nov 2002 21:37:33 +0000 (21:37 +0000)
committerJan Nieuwenhuizen <janneke@gnu.org>
Mon, 4 Nov 2002 21:37:33 +0000 (21:37 +0000)
* scripts/ly2dvi.py: Fix: redirect latex progress/error output to
stderr (by default this goes to stdout).  Show lilypond progress,
even when not verbose.

* python/lilylib.py (system): New optional parameter to control
showing of progress.

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

index 8af30925daad58af4d37ceb13e484530563466e5..2d262a647d32222ff84891d3b53687f4ea35b9a1 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,8 +1,12 @@
 2002-11-04  Jan Nieuwenhuizen  <janneke@gnu.org>
 
+       * scripts/lilypond-book.py:
        * scripts/ly2dvi.py: Fix: redirect latex progress/error output to
        stderr (by default this goes to stdout).  Show lilypond progress,
-       even when not verbose.  Ugh.
+       even when not verbose.
+
+       * python/lilylib.py (system): New optional parameter to control
+       showing of progress.
 
        * scm/backend-documentation-lib.scm (check-dangling-properties):
        Fix error message.
index f929cd3bada9817e31bb0c837208306fbcc0f13c..d9250f0807ad0079c94bbb385c55ea6750107a23 100644 (file)
@@ -241,10 +241,10 @@ def read_pipe (cmd, mode = 'r'):
                progress ('\n')
        return output
 
-def system (cmd, ignore_error = 0):
+def system (cmd, ignore_error = 0, progress_p = 0):
        
-       ''' Run CMD.  If IGNORE_ERROR is set, do not complain when CMD
-returns non zero.
+       '''System CMD.  If IGNORE_ERROR, do not complain when CMD
+returns non zero.  If PROGRESS_P, always show progress.
 
 RETURN VALUE
 
@@ -252,27 +252,30 @@ Exit status of CMD '''
 
        name = command_name (cmd)
 
-       redirect = ''
        if __main__.verbose_p:
+               progress_p = 1
                progress (_ ("Invoking `%s\'") % cmd)
-               if __main__.pseudo_filter_p:
-                       redirect = ' 1> /dev/null'
        else:
                progress ( _("Running %s...") % name)
-               redirect = ' 1> /dev/null 2>%s' % error_log (name)
 
+       redirect = ''
+       if not progress_p:
+               redirect = ' 1>/dev/null 2>' + error_log (name)
+       elif __main__.pseudo_filter_p:
+               redirect = ' 1>/dev/null'
+                       
        status = os.system (cmd + redirect)
        signal = 0x0f & status
        exit_status = status >> 8
        
        if status:
-               msg = _ ("`%s\' failed (%d)") % (name, status / exit_status)
+               msg = _ ("`%s\' failed (%d)") % (name, exit_status)
                if ignore_error:
                        if __main__.verbose_p:
                                warning (msg + ' ' + _ ("(ignored)"))
                else:
                        error (msg)
-                       if not __main__.verbose_p:
+                       if not progress_p:
                                error (_ ("The error log is as follows:"))
                                sys.stderr.write (open (error_log (name)).read ())
                        exit (status)
index b0be30e7ae603d99e86152d4fe308d2be220525a..38f4a51fd29f382ac45f2a982ef95be469b8d206 100644 (file)
@@ -171,6 +171,9 @@ class LatexPaper:
                re_dim = re.compile (r"\\(\w+)\s+(\d+\.\d+)")
 
                cmd = "latex '\\nonstopmode \input %s'" % fname
+               # Ugh.  (La)TeX writes progress and error messages on stdout
+               # Redirect to stderr
+               cmd += ' 1>/dev/stderr'
                status = ly.system (cmd, ignore_error = 1)
                signal = 0xf & status
                exit_status = status >> 8
@@ -1112,7 +1115,7 @@ def compile_all_files (chunks):
                texfiles = string.join (tex)
                cmd = string.join ((lilypond_cmd, lilyopts, g_extra_opts,
                                    texfiles))
-               ly.system (cmd)
+               ly.system (cmd, ignore_error = 0, progress_p = 1)
 
                #
                # Ugh, fixing up dependencies for .tex generation
@@ -1132,7 +1135,11 @@ def compile_all_files (chunks):
                                f.close ()
 
        def to_eps (file):
-               ly.system (r"latex '\nonstopmode \input %s'" % file)
+               cmd = r"latex '\nonstopmode \input %s'" % file
+               # Ugh.  (La)TeX writes progress and error messages on stdout
+               # Redirect to stderr
+               cmd += ' 1>/dev/stderr'
+               ly.system (cmd)
                ly.system ("dvips -E -o %s.eps %s" % (file, file))
        map (to_eps, eps)
 
index 95be3e49100af380442da8692548640de52ff071..814783e8722f2b4793986af1a404c320ecd390a3 100644 (file)
@@ -246,16 +246,7 @@ def run_lilypond (files, dep_prefix):
                ly.print_environment ()
 
        cmd = string.join ((lilypond_cmd,opts, fs))
-       
-       # We set verbose, because we always want to see lily's
-       # progess on stderr
-       save_verbose = verbose_p
-       
-       # Ugh, this gives ugly full Invoking ... command
-       verbose_p = 1
-       status = ly.system (cmd, ignore_error = 1)
-       verbose_p = save_verbose
-
+       status = ly.system (cmd, ignore_error = 1, progress_p = 1)
        signal = 0x0f & status
        exit_status = status >> 8