def create_song_manus_pdf(revue): path = revue.conf["Paths"] # Create front page, if it doesn't already exist: # if not os.path.exists(os.path.join(path["pdf"], "cache")): # os.mkdir(os.path.join(path["pdf"], "cache")) # if not os.path.isfile(os.path.join(path["pdf"], "cache", "forside-sangmanuskript.pdf")): # Det tager vare på sig selv nu tex = TeX(revue) tex.create_frontpage(subtitle="sangmanuskript") tex.topdf("forside-sangmanuskript.pdf", outputdir=os.path.join(path["pdf"], "cache")) # Create song manuscript: file_list = [ os.path.join(path["pdf"], "cache", "forside-sangmanuskript.pdf") ] for act in revue.acts: for material in act.materials: if material.category == path["songs"]: file_list.append((os.path.join( path["pdf"], os.path.dirname(os.path.relpath(material.path)), "{}.pdf".format(material.file_name[:-4])), material.title)) pdf = PDF() pdf.pdfmerge(file_list, os.path.join(path["pdf"], "sangmanuskript.pdf"))
def create_song_manus_pdf(revue): path = revue.conf["Paths"] # Create front page, if it doesn't already exist: if not os.path.exists(os.path.join(path["pdf"], "cache")): os.mkdir(os.path.join(path["pdf"], "cache")) if not os.path.isfile(os.path.join(path["pdf"], "cache", "forside-sangmanuskript.pdf")): tex = TeX(revue) tex.create_frontpage(subtitle="sangmanuskript") tex.topdf("forside-sangmanuskript.pdf", outputdir=os.path.join(path["pdf"], "cache")) # Create song manuscript: file_list = [os.path.join(path["pdf"], "cache", "forside-sangmanuskript.pdf")] for act in revue.acts: for material in act.materials: if material.category == path["songs"]: file_list.append(os.path.join(path["pdf"], path["songs"], "{}.pdf".format(material.file_name[:-4]))) pdf = PDF() pdf.pdfmerge(file_list, os.path.join(path["pdf"],"sangmanuskript.pdf"))
if "--tex-all" in sys.argv: conf["TeXing"]["force TeXing of all files"] = "yes" revue = cr.Revue.fromfile("aktoversigt.plan") path = revue.conf["Paths"] conv = cv.Converter() if len(conf.cmd_parts) == 0: arglist = ("aktoversigt", "roles", "frontpage", "props", "contacts", "material", "individual", "songmanus") elif "manus" in sys.argv: arglist = ("aktoversigt", "roles", "frontpage", "props", "contacts", "material") else: arglist = sys.argv[1:] create_parts(revue, arglist) if len(conf.cmd_parts) == 0 or "manus" in sys.argv: pdf = PDF() pdf.pdfmerge( ((os.path.join(path["pdf"], "forside.pdf"), "Forside"), (os.path.join(path["pdf"], "aktoversigt.pdf"), "Aktoversigt"), (os.path.join(path["pdf"], "rolleliste.pdf"), "Rolleliste"), revue, (os.path.join(path["pdf"], "rekvisitliste.pdf"), "Rekvisitliste"), (os.path.join(path["pdf"], "kontaktliste.pdf"), "Kontaktliste")), os.path.join(path["pdf"], "manuskript.pdf")) print("Manuscript successfully created!")
elif "manus" in sys.argv: arglist = ("aktoversigt", "roles", "frontpage", "props", "contacts", "material") else: arglist = sys.argv[1:] for arg in arglist: create_parts(revue, arg) if len(conf.cmd_parts) == 0 or "manus" in sys.argv: pdf = PDF() pdf.pdfmerge((os.path.join(path["pdf"],"forside.pdf"), os.path.join(path["pdf"],"aktoversigt.pdf"), os.path.join(path["pdf"],"rolleliste.pdf"), revue, os.path.join(path["pdf"],"rekvisitliste.pdf"), os.path.join(path["pdf"],"kontaktliste.pdf")), os.path.join(path["pdf"],"manuskript.pdf")) print("Manuscript successfully created!") for act in revue.acts: for material in act.materials: metadata.update_mod_time(material) for f in glob.glob(os.path.join(path["pdf"], "*.pdf")): metadata.update_mod_time(f) for f in glob.glob(os.path.join(path["pdf cache"], "*.pdf")): metadata.update_mod_time(f) #embed()