]> git.donarmstrong.com Git - lilypond.git/commitdiff
* scripts/lilypond-book.py (output_verbatim): python 2.2 workaround.
authorHan-Wen Nienhuys <hanwen@xs4all.nl>
Wed, 4 Sep 2002 23:28:00 +0000 (23:28 +0000)
committerHan-Wen Nienhuys <hanwen@xs4all.nl>
Wed, 4 Sep 2002 23:28:00 +0000 (23:28 +0000)
* scm/documentation-lib.scm (scm->string): print procedure name in
stead of #<procedure .. >

* scripts/ly2dvi.py (run_lilypond): exit with error if lily exited
any file with an error.

* input/regression/molecule-hacking.ly: also restore Y
extent. Fixes bugs with stem attachment of parenthesized note
heads.

ChangeLog
buildscripts/lilypond-login.sh
buildscripts/lilypond-profile.sh
input/regression/molecule-hacking.ly
lily/stem-engraver.cc
scm/documentation-lib.scm
scripts/lilypond-book.py
scripts/ly2dvi.py

index ece84a094c0e1174852e4173024ea0d79af62a1a..c0703d4baf135948b1d73358a743cc16c0072d0a 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,13 @@
 2002-09-05  Han-Wen Nienhuys  <hanwen@cs.uu.nl>
 
+       * scripts/lilypond-book.py (output_verbatim): python 2.2 workaround.
+
+       * scm/documentation-lib.scm (scm->string): print procedure name in
+       stead of #<procedure .. > 
+
+       * scripts/ly2dvi.py (run_lilypond): exit with error if lily exited
+       any file with an error.
+
        * input/regression/molecule-hacking.ly: also restore Y
        extent. Fixes bugs with stem attachment of parenthesized note
        heads.
index 21333f50ba0b8bcc782f9d5f8b797c1ff5a6eb7c..8279c4778d0ce167492557d1b60022f9dabd933c 100644 (file)
 # strange shell, this C
 set datadir="@local_lilypond_datadir@"
 
- if ( $?GS_LIB ) then
-       setenv GS_LIB "$datadir/ps:$GS_LIB"
- else
-       setenv GS_LIB "$datadir/ps"
- endif
-
-
 # setenv LILYPONDPREFIX "$datadir"
-
 # bit silly. for ly2dvi, overrules compiled-in datadir...
 # setenv LILYPONDPREFIX "@local_lilypond_datadir@"
 
@@ -31,11 +23,21 @@ set noglob
 setenv TEXMF "{$datadir,"`kpsexpand  \$TEXMF`"}"
 unset noglob
 
+
+
+# if ( $?GS_LIB ) then
+#       setenv GS_LIB "$datadir/ps:$GS_LIB"
+# else
+#       setenv GS_LIB "$datadir/ps"
+# endif
+
+
+
 # Add all available TeX Type1 fonts (including Feta) to Ghostscript:
-if ( $?GS_FONTPATH ) then
-       setenv GS_FONTPATH `kpsewhich -expand-path=\$T1FONTS`:$GS_FONTPATH
-else
-       setenv GS_FONTPATH `kpsewhich -expand-path=\$T1FONTS`
-endif
+#if ( $?GS_FONTPATH ) then
+#       setenv GS_FONTPATH `kpsewhich -expand-path=\$T1FONTS`:$GS_FONTPATH
+#else
+#       setenv GS_FONTPATH `kpsewhich -expand-path=\$T1FONTS`
+#endif
 
 
index 6f88b34523ed49508c30dab7829e814d170a93e4..f1a941c411c6b95692e2d875b5b9ad2a140a3159 100644 (file)
@@ -23,12 +23,12 @@ TEXMF="{$datadir,"`kpsexpand  \\$TEXMF`"}"
 export TEXMF
 
 # For direct ps output: ps/lilyponddefs.ps
-GS_LIB="$datadir/ps:"${GS_LIB:=""}
-export GS_LIB
+## GS_LIB="$datadir/ps:"${GS_LIB:=""}
+## export GS_LIB
 
 # For direct ps output fonts. Add all available TeX Type1 fonts
-GS_FONTPATH=`kpsewhich -expand-path=\\$T1FONTS`:${GS_FONTPATH:=""}
-export GS_FONTPATH
+## GS_FONTPATH=`kpsewhich -expand-path=\\$T1FONTS`:${GS_FONTPATH:=""}
+## export GS_FONTPATH
 
        
 
index b14b817996ad565021dea65a4a94290ca8c73ab0..3ff3c6a685ead1d9ae3f7aaf127011716bea775f 100644 (file)
@@ -9,7 +9,7 @@ Beam. The note head is also rather naive, since the extent of the
 parens are also not seen by accidentals.
 "
        
-        }
+}
 
 #(define (parenthesize-callback callback)
    "Construct a function that will do CALLBACK and add parentheses.
index 25c5f019542159e7215b3ffae917d0aba0075a0f..b1f3eb4b9957c5a26ba92dd7ce005b53fbb640c3 100644 (file)
@@ -79,18 +79,21 @@ Stem_engraver::acknowledge_grob (Grob_info i)
                the first and last (quarter) note bothe get one tremolo flag.
               */
              int requested_type = gh_scm2int (tremolo_req_->get_mus_property ("tremolo-type"));
-             if (requested_type <= 8)
-               {
-                 tremolo_req_->origin()->warning (_("tremolo duration is too long"));
-                 requested_type = 0;
-               }
              SCM f = get_property ("tremoloFlags");
              if (!requested_type && gh_number_p (f))
                requested_type = gh_scm2int (f);
              else
                daddy_trans_->set_property ("tremoloFlags", gh_int2scm (requested_type));
 
-             if (requested_type)
+             int tremolo_flags = intlog2 (requested_type) - 2
+               - (duration_log > 2 ? duration_log - 2 : 0);
+             if (tremolo_flags <= 0)
+               {
+                 tremolo_req_->origin()->warning (_("tremolo duration is too long"));
+                 tremolo_flags = 0;
+               }
+
+             if (tremolo_flags)
                {
                  tremolo_ = new Item (get_property ("StemTremolo"));
                  announce_grob(tremolo_, tremolo_req_->self_scm());
@@ -100,11 +103,7 @@ Stem_engraver::acknowledge_grob (Grob_info i)
                    the tremolo-type minus the number of flags of the note
                    itself.
                   */
-                 int tremolo_flags = intlog2 (requested_type) - 2
-                   - (duration_log > 2 ? duration_log - 2 : 0);
-                 if (tremolo_flags < 0)
-                   tremolo_flags = 0;
-                 tremolo_->set_grob_property ("flag-count",
+                         tremolo_->set_grob_property ("flag-count",
                                                gh_int2scm (tremolo_flags));
                  tremolo_->set_parent (stem_, X_AXIS);
                }
index ba9685ad0a0448f644fe625ca3c4154816047208..cb030c50d5274949cbc25297ca92be4ba4649922 100644 (file)
   (string-append "@code{" (texify (scm->string x)) "}")
   )
 
+
+;;
+;; don't confuse users with #<procedure .. > syntax. 
+;; 
 (define (scm->string val)
-  (string-append
-   (if (self-evaluating? val) "" "'")
-   (call-with-output-string (lambda (port) (display val port)))
-  ))
+  (if (procedure? val)
+      (symbol->string (procedure-name val))
+      (string-append
+       (if (self-evaluating? val) "" "'")
+       (call-with-output-string (lambda (port) (display val port)))
+       )))
 
 (define (node name)
   (string-append
index cd3bf0de691a53c066ecb5976caa937fd9d6cc33..be57defa604835fd0380e9c007f3fc4255539552 100644 (file)
@@ -456,7 +456,11 @@ def output_verbatim (body, small):
                body = re.sub ('>', '&gt;', body)
                body = re.sub ('<', '&lt;', body)
        elif __main__.format == 'texi':
-               body = re.sub ('([@{}])', '@\\1', body)
+               
+               # clumsy workaround for python 2.2 pre bug.
+               body = re.sub ('@', '@@', body)
+               body = re.sub ('{', '@{', body)
+               body = re.sub ('}', '@}', body)
 
        if small:
                key = 'output-small-verbatim'
index 6428188e1fa0706073f602cc1d7c2fe47a48d915..0c3dd95158dfe31d7926b459408948cfa4ba7b84 100644 (file)
@@ -130,9 +130,13 @@ def user_error (s, e=1):
                sys.exit (e)
        
 def error (s):
-       '''Report the error S.  Exit by raising an exception. Please
-       do not abuse by trying to catch this error. If you do not want
-       a stack trace, write to the output directly.
+       '''Report the error S.
+
+       If verbose is set, exit by raising an exception. Otherwise,
+       simply sys.exit().
+
+       Please do not abuse by trying to catch this error. If you do
+       not want a stack trace, write to the output directly.
 
        RETURN VALUE
 
@@ -141,7 +145,10 @@ def error (s):
        '''
        
        progress (_ ("error: ") + s)
-       raise _ ("Exiting ... ")
+       if verbose_p:
+               raise _ ("Exiting ... ")
+       else:
+               sys.exit (2)
 
 def getopt_args (opts):
        '''Construct arguments (LONG, SHORT) for getopt from  list of options.'''
@@ -321,6 +328,7 @@ errorport = sys.stderr
 keep_temp_dir_p = 0
 verbose_p = 0
 preview_p = 0
+lilypond_error_p = 0
 preview_resolution = 90
 pseudo_filter_p = 0
 latex_cmd = 'latex'
@@ -512,7 +520,9 @@ def run_lilypond (files, dep_prefix):
                sys.stderr.write ( "\n" \
                        + _ ("LilyPond failed on an input file (exit status %d).") % exit_status + "\n")
                sys.stderr.write (_("Trying to salvage the rest.") +'\n\n')
-               
+
+               global lilypond_error_p
+               lilypond_error_p = 1
                
 
 def analyse_lilypond_output (filename, extra):
@@ -1107,7 +1117,8 @@ if files:
                        
        os.chdir (original_dir)
        cleanup_temp ()
-       
+
+       sys.exit (lilypond_error_p)
 else:
        help ()
        user_error (_ ("no files specified on command line"), 2)