From d005ec30614c145d55148e94c9d74553869712c3 Mon Sep 17 00:00:00 2001 From: Louis Date: Mon, 17 Feb 2014 14:14:58 +0100 Subject: [PATCH] Nettoyage des fichiers temporaires --- songbook/build.py | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/songbook/build.py b/songbook/build.py index fb235f6b..71906447 100755 --- a/songbook/build.py +++ b/songbook/build.py @@ -58,6 +58,24 @@ def formatDeclaration(name, parameter): def formatDefinition(name, value): return '\\set@{name}{{{value}}}\n'.format(name=name, value=value) +def clean(basename): + generated_extensions = [ + "_auth.sbx", + "_auth.sxd", + ".aux", + ".log", + ".out", + ".sxc", + ".tex", + "_title.sbx", + "_title.sxd", + ] + + for ext in generated_extensions: + os.unlink(basename + ext) + + return True + def makeTexFile(sb, output): datadir = sb['datadir'] name = output[:-4] @@ -199,3 +217,7 @@ def buildsongbook(sb, basename): # Second pdflatex pass if call(["pdflatex", "--shell-escape", texFile]): sys.exit(1) + + # Cleaning + if not clean(basename): + sys.exit(1)