prochains films dans filmsCode2 ; pb à régler
This commit is contained in:
parent
f1a4a5ccea
commit
2acb5f034d
2 changed files with 27 additions and 17 deletions
|
@ -50,7 +50,7 @@ class film():
|
|||
return res
|
||||
|
||||
def calendrier(self):
|
||||
res = '<!-- Film #' + str(self.i) + ' --> <div class="entry-mainblock"> <div class="entry-separator">'
|
||||
res = '<!-- Film #' + str(self.i) + ' --> \n \n <div class="entry-mainblock"> <div class="entry-separator">'
|
||||
res += '<img class="entry-poster" src="http://www.cof.ens.fr/cineclub/blogImages/2016-2017/affiche-1-thumbnail200.jpg" alt="" /></div>'
|
||||
res += '<div class="entry-text-info"><br /><br /><b>' + self.date +', 20h30 <br /><i>'
|
||||
res += self.nom + '</i> de ' + self.realisateur +' (' +str(self.annee) + ')</b><br /><br />'
|
||||
|
@ -62,7 +62,7 @@ class film():
|
|||
res += " . " + self.pays + ". <br /> Avec : " + strListe(self.acteurs) + ".<br/><br/>"
|
||||
res += '<span class="entry-synopsis">' + self.synopsis + '</span><br/><br/></div>'
|
||||
res += '</div><br/><a style="float: right;" href="#haut">Retour en haut de page</a>'
|
||||
res += "<br/><!-- END OF POST --><br/>"
|
||||
res += "<br/>\n \n<!-- END OF POST --><br/>"
|
||||
return res
|
||||
|
||||
def bocal(self):
|
||||
|
@ -122,14 +122,22 @@ def strListe(liste):
|
|||
res += liste[-1]
|
||||
return res
|
||||
|
||||
def nouveauFilm():
|
||||
i = 38
|
||||
|
||||
def nouveauFilm(dicFilms = {}, index = {}):
|
||||
ind, dic = True, True
|
||||
if dicFilms == {}:
|
||||
with open('filmsCode', 'rb') as file:
|
||||
pickler = pickle.Unpickler(file)
|
||||
dicFilms = pickler.load()
|
||||
dic = False
|
||||
if index == {}:
|
||||
with open('index', 'rb') as index:
|
||||
pickler = pickle.Unpickler(index)
|
||||
dicIndex = pickler.load()
|
||||
i = pickler.load() + 1
|
||||
ind = False
|
||||
i += 1
|
||||
idN = input("identifiant du film ? ")
|
||||
date = input("date de la séance (format mardi JJ MOIS AAAA) ")
|
||||
nom = input("titre ? ")
|
||||
|
@ -144,10 +152,12 @@ def nouveauFilm():
|
|||
seance = film(i, idN, date, nom, acteurs, realisateur, duree, synopsis, pays, annee, youtube, couleur)
|
||||
dicIndex[i] = idN
|
||||
dicFilms[idN] = seance
|
||||
if not(ind) :
|
||||
with open('index', 'wb') as index:
|
||||
pickler = pickle.Pickler(index)
|
||||
pickler.dump(dicIndex)
|
||||
pickler.dump(i)
|
||||
if not(dic):
|
||||
with open('filmsCode', 'wb') as fichier:
|
||||
mon_pickler = pickle.Pickler(fichier)
|
||||
mon_pickler.dump(dicFilms)
|
||||
|
|
BIN
filmsCode2
Normal file
BIN
filmsCode2
Normal file
Binary file not shown.
Loading…
Reference in a new issue