From: Reinhold Kainhofer Date: Sat, 3 Nov 2012 19:47:49 +0000 (+0100) Subject: Template: Create instruments tex file only if we have any instruments X-Git-Url: https://repo.or.cz/w/orchestrallily.git/commitdiff_plain/6c2f91fbf88573caafe60d0a84835116cec8cd4c Template: Create instruments tex file only if we have any instruments --- diff --git a/generate_oly_score.py b/generate_oly_score.py index 047fb41..c614b03 100755 --- a/generate_oly_score.py +++ b/generate_oly_score.py @@ -478,14 +478,19 @@ def generate_tex_files (settings, lily_files): #this_settings["scorenamebase"] = "Name"; tex_files.append (write_texscore_file (settings, this_settings, "TeX_Score.tex", score)) - this_settings = copy.deepcopy (tex_settings); - this_settings["scoretype"] = "InstrumentalParts"; - tmpopts = this_settings.get ("tex_options", []) - tmpopts.append (tex_options_map.get (this_settings["scoretype"], "")) - this_settings["tex_options"] = tmpopts - if "createCriticalComments" not in tex_settings: - this_settings["createCriticalComments"] = score not in no_criticalcomments_scores; - tex_files.append (write_texscore_file (settings, this_settings, "TeX_Instruments.tex", "Instruments")) + + # Create the tex instruments file only if we have instruments! + if set(this_settings["instruments"]) != set(this_settings["noscore_instruments"]): + this_settings = copy.deepcopy (tex_settings); + this_settings["scoretype"] = "InstrumentalParts"; + tmpopts = this_settings.get ("tex_options", []) + tmpopts.append (tex_options_map.get (this_settings["scoretype"], "")) + this_settings["tex_options"] = tmpopts + if "createCriticalComments" not in tex_settings: + this_settings["createCriticalComments"] = score not in no_criticalcomments_scores; + tex_files.append (write_texscore_file (settings, this_settings, "TeX_Instruments.tex", "Instruments")) + else: + print " No separate instrumental scores, not creating instruments tex file." return [tex_files, tex_includes];