From: fred Date: Tue, 26 Mar 2002 22:26:24 +0000 (+0000) Subject: lilypond-1.2.9 X-Git-Tag: release/1.5.59~2145 X-Git-Url: https://git.donarmstrong.com/?a=commitdiff_plain;h=bd3204b78847f9436d50c7d3eff0bbb3ba7f33de;p=lilypond.git lilypond-1.2.9 --- diff --git a/lily/gourlay-breaking.cc b/lily/gourlay-breaking.cc index e9d0ecb801..de9da6836d 100644 --- a/lily/gourlay-breaking.cc +++ b/lily/gourlay-breaking.cc @@ -86,8 +86,8 @@ Gourlay_breaking::do_solve () const Line_of_cols line = all.slice (breaks[start_idx], breaks[break_idx]+1); - line[0] = dynamic_cast(line[0]->find_prebroken_piece (RIGHT)); - line.top () = dynamic_cast(line.top ()->find_prebroken_piece (LEFT)); + line[0] = dynamic_cast(line[0]->find_broken_piece (RIGHT)); + line.top () = dynamic_cast(line.top ()->find_broken_piece (LEFT)); if (!feasible (line)) break; @@ -99,14 +99,12 @@ Gourlay_breaking::do_solve () const pscore_l_->paper_l_->line_dimensions_int (optimal_paths[start_idx].line_i_)); spacer_p_list.append (new Killing_cons (approx.spacer_l_,0)); - ( (Break_algorithm*)this)->approx_stats_.add (approx.cols_); approx.approximate_solve_line (); if (approx.energy_f_ > energy_bound_f_) { continue; } - // this is a likely candidate. Store it. candidate_lines.push (approx); @@ -127,7 +125,6 @@ Gourlay_breaking::do_solve () const if (!candidate_lines[j].satisfies_constraints_b_) { candidate_lines[j].solve_line (); - ( (Break_algorithm*)this)->exact_stats_.add (candidate_lines[j].cols_); } Real this_energy @@ -161,7 +158,9 @@ Gourlay_breaking::do_solve () const } if (break_idx % HAPPY_DOTS_I) - *mlog << "[" << break_idx << "]" << flush; + *mlog << "[" << break_idx << "]"; + + *mlog << endl; Array final_breaks; diff --git a/lily/lily-guile.cc b/lily/lily-guile.cc index b28b18f695..b2017c27af 100644 --- a/lily/lily-guile.cc +++ b/lily/lily-guile.cc @@ -79,9 +79,9 @@ read_lily_scm_file (String fn) String s = global_path.find (fn); if (s == "") { - String e = _f ("can't find file: `%s\'", fn); + String e = _f ("Can't find file: `%s'", fn); e += " "; - e += _f ("(load path: `%s\')", global_path.str ()); + e += _f ("(load path: `%s')", global_path.str ()); error (e); } else @@ -91,7 +91,7 @@ read_lily_scm_file (String fn) Simple_file_storage f(s); ly_ch_C_eval_scm ((char *) f.ch_C()); - *mlog << ']' << flush; + *mlog << "]" << flush; } @@ -102,9 +102,9 @@ ly_gulp_file (SCM name) String s = global_path.find (fn); if (s == "") { - String e = _f ("can't find file: `%s\'", fn); + String e = _f ("Can't find file: `%s'", fn); e += " "; - e += _f ("(load path: `%s\')", global_path.str ()); + e += _f ("(load path: `%s')", global_path.str ()); error (e); } else diff --git a/scripts/mudela-book.py b/scripts/mudela-book.py index e679cae1d8..d33127e39f 100644 --- a/scripts/mudela-book.py +++ b/scripts/mudela-book.py @@ -57,6 +57,7 @@ options = [ format = '' run_lilypond = 1 +use_hash = 1 no_match = 'a\ba' # format specific strings, ie. regex-es for input, and % strings for output @@ -498,7 +499,7 @@ def advance_counters (counter, opts, str): opts.append ('twocolumn') elif g == 'onecolumn': try: - current_opts.remove ('twocolumn') + opts.remove ('twocolumn') except IndexError: pass elif g == 'chapter': @@ -516,7 +517,7 @@ def schedule_mudela_block (base, chunk, extra_opts): for the main file). The .ly is written, and scheduled in TODO. - Return: a chunk (TYPE_STR, MAIN_STR, OPTIONS, TODO) + Return: a chunk (TYPE_STR, MAIN_STR, OPTIONS, TODO, BASE) TODO has format [basename, extension, extension, ... ] @@ -531,10 +532,13 @@ def schedule_mudela_block (base, chunk, extra_opts): newbody = output_verbatim (body) file_body = compose_full_body (body, opts) - updated = update_file (file_body, base + '.ly') - todo = [base] # UGH. + basename = base + if __main__.use_hash: + basename = `abs(hash (file_body))` + updated = update_file (file_body, basename + '.ly') + todo = [basename] # UGH. - if not os.path.isfile (base + '.tex') or updated: + if not os.path.isfile (basename + '.tex') or updated: todo.append ('tex') updated = 1 @@ -550,25 +554,24 @@ def schedule_mudela_block (base, chunk, extra_opts): opts.append ('eps') if 'eps' in opts and ('tex' in todo or - not os.path.isfile (base + '.eps')): + not os.path.isfile (basename + '.eps')): todo.append ('eps') if 'png' in opts and ('eps' in todo or - not os.path.isfile (base + '.png')): + not os.path.isfile (basename + '.png')): todo.append ('png') if format == 'latex': if 'eps' in opts : - newbody = newbody + get_output ('output-eps') % (base, base) + newbody = newbody + get_output ('output-eps') % (basename, basename) else: - newbody = newbody + get_output ('output-tex') % base + newbody = newbody + get_output ('output-tex') % basename elif format == 'texi': - newbody = newbody + get_output ('output-all') % (base, base) + newbody = newbody + get_output ('output-all') % (basename, basename) + return ('mudela', newbody, opts, todo, base) - - return ('mudela', newbody, opts, todo) def find_eps_dims (match): "Fill in dimensions of EPS files." @@ -654,6 +657,7 @@ def compile_all_files (chunks): eps = [] tex = [] png = [] + hash_dict = {} for c in chunks: if c[0] <> 'mudela': @@ -668,6 +672,9 @@ def compile_all_files (chunks): elif e == 'png': png.append (base) + if __main__.use_hash: + hash_dict[c[4]] = c[3][0] + if tex: lilyopts = map (lambda x: '-I ' + x, include_path) lilyopts = string.join (lilyopts, ' ' ) @@ -685,6 +692,22 @@ def compile_all_files (chunks): cmd = cmd % (g + '.eps', g + '.png') system (cmd) + if __main__.use_hash: + name = '' + last_name = '' + f = 0 + ks = hash_dict.keys () + ks.sort () + for i in ks: + name = re.sub ("(.*)-[0-9]+\.[0-9]+\.[0-9]+", "\\1", i) + name = name + '.mix' + if name != last_name: + if last_name: + f.close () + f = open (name, 'w') + last_name = name + f.write ("%s:%s\n" % (i, hash_dict[i])) + def update_file (body, name): same = 0