%s
%s
-''' % ( _ ('Copyright (c) %s by') % '2001--2011',
+''' % ( _ ('Copyright (c) %s by') % '2001--2012',
'\n '.join (authors),
_ ("Distributed under terms of the GNU General Public License."),
_ ("It comes with NO WARRANTY.")))
current = os.getcwd()
os.chdir (directory)
- ly.system(cmd,
+ """NB - ignore_error is deliberately set to the same value
+ as redirect_output - this is not a typo."""
+ retval = ly.system(cmd,
be_verbose=ly.is_verbose (),
redirect_output=global_options.redirect_output,
log_file=logfile,
- progress_p=1)
+ progress_p=1,
+ ignore_error=global_options.redirect_output)
+ if retval != 0:
+ print ("Error trapped by lilypond-book")
+ print ("\nPlease see " + logfile + ".log\n")
+ sys.exit(1)
+
os.chdir (current)
progress (_ ("Writing snippets..."))
for snippet in outdated:
snippet.write_ly()
- progress ('\n')
if outdated:
progress (_ ("Processing..."))
- progress ('\n')
process_snippets (options.process_cmd, outdated,
options.formatter, options.lily_output_dir)
output_files,
options.output_dir)
- progress ('\n')
-
###
# Format guessing data
new_str = ''.join (lines)
if oldstr == new_str:
progress (_ ("%s is up to date.") % file_name)
- progress ('\n')
# this prevents make from always rerunning lilypond-book:
# output file must be touched in order to be up to date
progress (_ ("Writing `%s'...") % file_name)
file (file_name, 'w').writelines (lines)
- progress ('\n')
def note_input_file (name, inputs=[]):
try:
progress (_ ("Reading %s...") % input_fullname)
source = in_handle.read ()
- progress ('\n')
if not included:
global_options.formatter.init_default_snippet_options (source)
# Let the formatter modify the chunks before further processing
chunks = global_options.formatter.process_chunks (chunks)
- progress ('\n')
if global_options.filter_cmd:
write_if_updated (output_filename,
elif global_options.process_cmd:
do_process_cmd (chunks, input_fullname, global_options)
progress (_ ("Compiling %s...") % output_filename)
- progress ('\n')
write_if_updated (output_filename,
[s.replacement_text ()
for s in chunks])
os.chdir (original_dir)
name = snippet.substring ('filename')
progress (_ ("Processing include: %s") % name)
- progress ('\n')
return do_file (name, included=True)
include_chunks = map (process_include,
except BookSnippet.CompileError:
os.chdir (original_dir)
progress (_ ("Removing `%s'") % output_filename)
- progress ('\n')
raise BookSnippet.CompileError
def do_options ():