From 13cfdf630c5135d2ffe3a8e9a2a018ef4afea188 Mon Sep 17 00:00:00 2001 From: Jordan ERNST Date: Tue, 17 Apr 2018 16:27:41 +0200 Subject: [PATCH] AutoGen db and Card dir --- Clients_IFPass - Template.csv | 1 - IFPass.py | 9 +++++++++ 2 files changed, 9 insertions(+), 1 deletion(-) delete mode 100644 Clients_IFPass - Template.csv diff --git a/Clients_IFPass - Template.csv b/Clients_IFPass - Template.csv deleted file mode 100644 index a0c24fe..0000000 --- a/Clients_IFPass - Template.csv +++ /dev/null @@ -1 +0,0 @@ -Titre;Prénom;Nom;Numéro de client;Date d'inscripton;Date d'expiration diff --git a/IFPass.py b/IFPass.py index f164412..879eda8 100644 --- a/IFPass.py +++ b/IFPass.py @@ -44,6 +44,14 @@ pdftemplate = IFPassdir + 'Templates\IFPass_PDF_Template.pdf' pngtemplate = IFPassdir + 'Templates\IFPass_PNG_Template.png' fonttemplate = IFPassdir + 'Templates\Roboto-Bold.ttf' +def initialisation(): + if not os.path.exists(imgdir): + os.makedirs(imgdir) + if not os.path.exists(clientsfile): + with open(clientsfile, 'w', newline='', encoding='utf-8') as csvfile: + writer = csv.writer(csvfile, delimiter=';') + writer.writerow(['Titre', 'Prénom', 'Nom', 'Numéro de client', 'Date d\'inscription', 'Date d\'expiration']) + def get_fullname(): firstname = input("Prénom : ").strip() @@ -250,6 +258,7 @@ while "the informations are incorrect": # Loop Filling informations if correct: os.system('cls') + initialisation() picture = getpic() clientID = getclientID() barcode = barcode_gen(clientID)