Browse Source

Nettoyage des fichiers temporaires

pull/3/head
Louis 11 years ago
parent
commit
d005ec3061
  1. 22
      songbook/build.py

22
songbook/build.py

@ -58,6 +58,24 @@ def formatDeclaration(name, parameter):
def formatDefinition(name, value): def formatDefinition(name, value):
return '\\set@{name}{{{value}}}\n'.format(name=name, value=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): def makeTexFile(sb, output):
datadir = sb['datadir'] datadir = sb['datadir']
name = output[:-4] name = output[:-4]
@ -199,3 +217,7 @@ def buildsongbook(sb, basename):
# Second pdflatex pass # Second pdflatex pass
if call(["pdflatex", "--shell-escape", texFile]): if call(["pdflatex", "--shell-escape", texFile]):
sys.exit(1) sys.exit(1)
# Cleaning
if not clean(basename):
sys.exit(1)

Loading…
Cancel
Save