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
'''
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.'''
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'
+ _ ("Please submit a bug report to bug-lilypond@gnu.org") + "\n")
if status:
- error ( "\n" \
- + _ ("LilyPond failed on the input file (exit status %d).") % exit_status + "\n")
+ 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):
ly_paper_to_latexpaper = {
'a4' : 'a4paper',
'letter' : 'letterpaper',
+ 'a3' : 'a3paper'
}
#TODO: should set textheight (enlarge) depending on papersize.
os.chdir (original_dir)
cleanup_temp ()
-
+
+ sys.exit (lilypond_error_p)
else:
help ()
user_error (_ ("no files specified on command line"), 2)