From 40f2d5e391b81ecbae6062f49c3fc2e4fb1a6bd7 Mon Sep 17 00:00:00 2001 From: Alice Date: Sat, 23 Mar 2019 10:52:02 +0100 Subject: [PATCH 1/3] correcting input of dates, duree and color boolean in insert new and correcting film removing calendar to come and actual database --- .gitignore | 2 ++ baseFilms.db | Bin 81920 -> 81920 bytes calendarToCome.html | 0 ccInterface.py | 17 +++++++++++--- cineclubBlogSQ.py | 53 +++++++++++++++++++++++++++++++++++--------- 5 files changed, 59 insertions(+), 13 deletions(-) delete mode 100644 calendarToCome.html diff --git a/.gitignore b/.gitignore index 8e9f01c..6c155f6 100644 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1,5 @@ *.jpg *.png *pycache* +*.db + diff --git a/baseFilms.db b/baseFilms.db index a787d044631d4d6d54b666be7b7edeef3dbd94e6..aa2c0bd7ec9ed237deead71cf8e103b17523f576 100644 GIT binary patch delta 2335 zcmZWqeP|qM8Q2e5$p;@dct9;B$a}3SQ-w-qErk>f;FXKhR872Jg$x8%TY3w+}GzpsWbxIgI zXLAD4xyZFUKQXayxS8Oy zW`iRg_WFEphBBSFo=^PSdpiiNGwix>mUvwg*mS5c(T&~r5Y~m4ESk0%>TEc6({~|m z0?w(IK^BHz=Z79AU?+Bk^Q=Z$CYVP) zBWMxVVH-6%8{Gq*?E?f5o(^yZF*!|23@}E)I5Mc~aa#2WgXl4XZ3I=Zi!7TNB!l!c zWGg<9W4m7GZ7z(`z#b=^w``Ht`39;2@R?w?js;Skw=e_(wjd>*Jvj-y=_K;ghUYo% zDQ)fcqod8K$xFUHU%xh6UJ%o#G_A(7OQf2mR=tqLy6fRABc8@9`SC)olFyChG>aG% zyBZ5dEkC9eOIj(f6~^Ixc%(QwI+mSx>cx^}UHcq*z6M?)5b6%x>pvs(Hk+4T{bHcE zN^kR6h1&ov_Pc^Bs)dm$g06Ju04&Q12=RG91mH?-6JRJa0}|f^5%L9l(OsZ}R~dq& z0SgA<3eH{P0Ot%~n8j`bXW%G&FA^QOKy`p2@tWepeP<2q2e1d!Q9^}~Er?l2OO;?WyesKUaY5CJuj0hA!96DSdYUML6*a9|G}7>sja)=YPr z8@dgqAY99LMRjDL&OobBKtLK^#zGIEMTi~F7-{Safx>bPR@|-#(v*4BqK43pP^(Zh z*E?^UFp))o%e?Rk(>jRB*F_bH@?#GlaHs)+{YP;IxCjUBb~ZDpn<^j#GOiKkg3f1z zEdh(sEq+v^riG06R_}K(ma+h&@8z}5D2tbRnZs`npxYHntJ*fA5sZ>z&IW<3A#~whVhrU$>A?^K(veL2&sC<*E{%I+ zbOm27f5tmKQY^W9HLd{!9@Vot++~mtUdcjuT46YM8_HRu`Qk{aG@^oiP=RU?6|!Q6 zYGDgAh>`?Fyja_LdQ?iwJ=Y`e??jMvRoeRMZ=r|%?Df`{!{O1bRx!Nuep)&#HTc898yRUD_9tN^_S8X6g(yF}QB0 zF{h%v?Yz<_z1y??M!$4)J>M@mJG=do9BzKHH3UaS%P&$7GmKuO3luIfgHx!a73lfB zqVfOFUw?ZTPE60uLf>;57+OZzHvs(%I&T=uXqtK;H`C0d+eO%Sd2XgbO$sd*y<}4^ z?wpG*t_BVFg6}jP=*pQ?D+62m%G1jjF2-fk<|o=J%zU=;5{62k7?t^gaAmp+xU-4T z$J^q7R=H+k18xwGZV2MxHa*f7=?qjZ)@_a^Z3{wS3-*EbAk3z2qG)>nUV3i|T^?ya Mzb~|Y?~JtaZ-cY}!~g&Q delta 215 zcmZo@U~On%ogmG)VWNyP?RUi))j61# zGRACYS6~cf+^%B5c$Im&fDL1TxJY9W3j?FJmrG( \n \t' @@ -340,28 +340,61 @@ class filmSQ(): pass return l + def input_date(): + ok = False + d = input("date de la séance (format JJ/MM/AAAA ) ") + while not ok: + try: + d = d.split("/") + res = date(int(d[2]), int(d[1]), int(d[0])) + ok = True + except IndexError: + print("Veuillez entrer la date au format JJ/MM/AAA") + return res + + def input_duree(): + ok = False + while not ok: + try: + res = eval(input("durée du film (en minutes) ")) + ok = true + except (NameError, SyntaxError): + print("le format n'est pas correct. Ne rentrez que des chiffres svp") + pass + pass + return res + + def input_color(): + ok = False + while not ok: + d = input("le film est-il en couleur (oui/non) ? ") + if d in ["True", "true", "oui", "Oui", "y", "o", "Y", "y", "O", "yes", "Yes"]: + res = True + ok = True + elif d in ["False", "false", "non", "Non", "n", "N", "no", "No"]: + res = False + ok = True + return res + def newFilm(): """Interface d'ajout d'un nouveau film""" dic = {} i = filmSQ.maxId() - + ok = False dic['i'] = i+1 dic['idN'] = input("identifiant du film ? ") - d = input("date de la séance (format JJ/MM/AAAA ) ") - d = d.split("/") - dic['date'] = date(int(d[2]), int(d[1]), int(d[0])) + dic['date'] = input_date() dic['nom'] = input("titre ? ") - dic['acteurs'] = filmSQ.makeListActors() - #eval(input("acteurs (format [acteur1, acteur2, ..]) ? ")) dic['realisateur'] = input("realisateur ? ") - dic['duree'] = eval(input("durée du film (en minutes)? ")) + dic['acteurs'] = filmSQ.makeListActors() dic['synopsis'] = input("Donnez ici un synopsis rapide du film ") dic['pays'] = input("pays de diffusion du film ? ") dic['annee'] = input("année de sortie du film (format AAAA) ? ") + dic['duree'] dic['youtube'] = input("adresse youtube de la bande-annonce ? ") dic['image'] = input("url d'une affiche du film ? ") - dic['couleur'] = eval(input("le film est-il en couleur (format True/False) ? ")) + dic['couleur'] = input_color(); dic['formatCopie'] = input("format de la copie ? ") dic['langST'] = input("langue et sous-titre : VF/VOSTFR ? ") From 85313df79b9b68e6f5588f588c1bdd077672dd4d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Cin=C3=A9-club=20Ulm?= Date: Sat, 23 Mar 2019 09:58:55 +0000 Subject: [PATCH 2/3] resolved merge --- .gitignore | 1 - baseFilms.db | Bin 81920 -> 81920 bytes cineclubBlogSQ.py | 1 - 3 files changed, 2 deletions(-) diff --git a/.gitignore b/.gitignore index 6c155f6..939836c 100644 --- a/.gitignore +++ b/.gitignore @@ -2,4 +2,3 @@ *.png *pycache* *.db - diff --git a/baseFilms.db b/baseFilms.db index aa2c0bd7ec9ed237deead71cf8e103b17523f576..7b940eafd725ec3b567530ee601150da4d7e6ea6 100644 GIT binary patch delta 26 icmZo@U~On%ogmG4Zla7c>p2G9k2@Muwx%%7u?GNvunG78 delta 26 icmZo@U~On%ogmG4cA|_k>sbapnGKC8TT>Y4*aHA~;0YQ4 diff --git a/cineclubBlogSQ.py b/cineclubBlogSQ.py index e5b5e2d..0495337 100644 --- a/cineclubBlogSQ.py +++ b/cineclubBlogSQ.py @@ -244,7 +244,6 @@ class filmSQ(): res += self.synopsis return res - def mail(self): res = ' \n \t \n \n \n \t \t' res += ' \n \t \t' From 03c8294489c8b7e7c46ea6d31a6ee963fe487329 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Cin=C3=A9-club=20Ulm?= Date: Mon, 1 Apr 2019 12:33:33 +0000 Subject: [PATCH 3/3] debug --- cineclubBlogSQ.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/cineclubBlogSQ.py b/cineclubBlogSQ.py index 0495337..1e228eb 100644 --- a/cineclubBlogSQ.py +++ b/cineclubBlogSQ.py @@ -383,17 +383,17 @@ class filmSQ(): ok = False dic['i'] = i+1 dic['idN'] = input("identifiant du film ? ") - dic['date'] = input_date() + dic['date'] = filmSQ.input_date() dic['nom'] = input("titre ? ") dic['realisateur'] = input("realisateur ? ") dic['acteurs'] = filmSQ.makeListActors() dic['synopsis'] = input("Donnez ici un synopsis rapide du film ") dic['pays'] = input("pays de diffusion du film ? ") dic['annee'] = input("année de sortie du film (format AAAA) ? ") - dic['duree'] + dic['duree'] = filmSQ.input_duree(); dic['youtube'] = input("adresse youtube de la bande-annonce ? ") dic['image'] = input("url d'une affiche du film ? ") - dic['couleur'] = input_color(); + dic['couleur'] = filmSQ.input_color(); dic['formatCopie'] = input("format de la copie ? ") dic['langST'] = input("langue et sous-titre : VF/VOSTFR ? ")