AUTO Deflate && TP3 temporaire

This commit is contained in:
Geoffrey Frogeye 2015-02-16 18:59:44 +01:00
parent ae6a9580a8
commit 22a63f7aeb

20
auto.py Normal file → Executable file
View file

@ -1,4 +1,14 @@
# Scipt permettant d'automatiser les TP
#!/usr/bin/python3
"""
TP AP1
Licence SESI 1ère année
Univ. Lille 1
Scipt permettant d'automatiser les TP
"""
__author__ = "PREUD'HOMME Geoffrey"
import os
import zipfile
@ -38,7 +48,11 @@ def tpEnCours():
def fichiersTp(semestre, tp):
# TODO .gitignore
# TODO .tpfiles
return fichiersPythons(semestre, tp)
fichiers = fichiersPythons(semestre, tp)
if semestre == 2 and tp == 3:
fichiers.remove('bataille_navale_graphique.py')
fichiers.append('jeu3.txt')
return fichiers
def fichiersPythons(semestre, tp):
@ -73,7 +87,7 @@ def creerZip(semestre, tp):
nomDossier = '_'.join(personnes)
nomZip = 'tp%d_%s.zip' % (tp, ('_'.join(personnes).lower()))
chem = chemin(semestre, tp)
fichierZip = zipfile.ZipFile(os.path.join(chem, nomZip), 'w')
fichierZip = zipfile.ZipFile(os.path.join(chem, nomZip), 'w', zipfile.ZIP_DEFLATED)
for f in fichiersTp(semestre, tp):
fichierZip.write(os.path.join(chem, f), os.path.join(nomDossier, f))
fichierZip.close()