From e1d09234e94b5ae44428c6a280b355a0fa660e36 Mon Sep 17 00:00:00 2001 From: Jordan ERNST Date: Wed, 25 Apr 2018 17:31:38 +0200 Subject: [PATCH 1/6] Moved pause after search --- IFPass.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/IFPass.py b/IFPass.py index 80df5b6..bbdb00a 100644 --- a/IFPass.py +++ b/IFPass.py @@ -345,6 +345,7 @@ while "The program is running": elif choix == '2': os.system('cls') membersearch() + os.system("pause") elif choix == '3': sys.exit() @@ -352,4 +353,3 @@ while "The program is running": else: os.system('cls') print(colored('Choix incorrect !', 'red', attrs=['bold'])) - os.system("pause") From 6eadfa97df59ab4a145a33cd86c2cccc668b66f7 Mon Sep 17 00:00:00 2001 From: Jordan ERNST Date: Wed, 14 Nov 2018 16:00:43 +0100 Subject: [PATCH 2/6] Updated INSTALL.txt --- INSTALL.txt | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/INSTALL.txt b/INSTALL.txt index 1d63d10..4b0cf4a 100644 --- a/INSTALL.txt +++ b/INSTALL.txt @@ -1,5 +1,7 @@ -Installer python 3.6 VERSION 64 bits : https://www.python.org/ftp/python/3.6.4/python-3.6.4-amd64-webinstall.exe --Téléchargez (cp36 pour Python 3.6) : https://www.lfd.uci.edu/~gohlke/pythonlibs/#opencv + -Cocher "Installer pour tous les utilisateurs" et "Ajouter python au PATH" -Installer les modules python termcolor, colorama, pyfiglet, code128, Pillow, numpy, pywinauto, PyPDF2 et opencv: -Lancer cmd.exe en tant qu'admin - -Exécuter : pip install termcolor colorama pyfiglet code128 Pillow pywinauto PyPDF2 numpy C:\path\to\opencv_python-3.4.0-cp36-cp36m-win_amd64.whl + -Exécuter : + -python -m pip install --upgrade pip + -pip install termcolor colorama pyfiglet code128 Pillow pywinauto PyPDF2 numpy opencv-contrib-python From 437015589f5fb181436b3be7c6b57d471e485903 Mon Sep 17 00:00:00 2001 From: Jordan ERNST Date: Thu, 15 Nov 2018 10:25:07 +0100 Subject: [PATCH 3/6] requirements.txt created. INSTALL.txt deleted --- INSTALL.txt | 7 ------- requirements.txt | 9 +++++++++ 2 files changed, 9 insertions(+), 7 deletions(-) delete mode 100644 INSTALL.txt create mode 100644 requirements.txt diff --git a/INSTALL.txt b/INSTALL.txt deleted file mode 100644 index 4b0cf4a..0000000 --- a/INSTALL.txt +++ /dev/null @@ -1,7 +0,0 @@ --Installer python 3.6 VERSION 64 bits : https://www.python.org/ftp/python/3.6.4/python-3.6.4-amd64-webinstall.exe - -Cocher "Installer pour tous les utilisateurs" et "Ajouter python au PATH" --Installer les modules python termcolor, colorama, pyfiglet, code128, Pillow, numpy, pywinauto, PyPDF2 et opencv: - -Lancer cmd.exe en tant qu'admin - -Exécuter : - -python -m pip install --upgrade pip - -pip install termcolor colorama pyfiglet code128 Pillow pywinauto PyPDF2 numpy opencv-contrib-python diff --git a/requirements.txt b/requirements.txt new file mode 100644 index 0000000..e50256a --- /dev/null +++ b/requirements.txt @@ -0,0 +1,9 @@ +code128==0.3 +colorama==0.4.0 +numpy==1.15.4 +opencv-contrib-python==3.4.3.18 +Pillow==5.3.0 +pyfiglet==0.7.6 +PyPDF2==1.26.0 +pywinauto==0.6.5 +termcolor==1.1.0 From 56d3b27ef9101a9a4e7058fb07665a19747ce60a Mon Sep 17 00:00:00 2001 From: Jordan ERNST Date: Mon, 10 Dec 2018 16:18:23 +0100 Subject: [PATCH 4/6] Code formatting --- IFPass.py | 22 ++++++++++------------ 1 file changed, 10 insertions(+), 12 deletions(-) diff --git a/IFPass.py b/IFPass.py index bbdb00a..a50837b 100644 --- a/IFPass.py +++ b/IFPass.py @@ -22,7 +22,7 @@ from colorama import init from termcolor import colored -version = 'devnocam' # dev/devnocam +version = 'devnocam' # dev/devnocam config = 'IFPass.conf' @@ -34,7 +34,7 @@ def initialisation(): if not os.path.exists(config): # Check if config file exists print('Fichier de configuration introuvable.') IFPassdir = input(r'Quel est le répertoire IFPass ? (Ex : \\192.168.1.1\IFPass) : ') - printername = input("Quel est le nom de l'imprimante à cartes ? : " ) + printername = input("Quel est le nom de l'imprimante à cartes ? : ") AcrobatReader = input(r"Quel est le chemain vers Acrobat Reader ? ( Ex : C:\Program Files (x86)\Adobe\Acrobat Reader DC\Reader\AcroRd32.exe) : ") conf['DEFAULT'] = {'IFPassdir': IFPassdir, 'printername': printername, 'AcrobatReader': AcrobatReader} with open(config, 'w') as configfile: @@ -45,7 +45,6 @@ def initialisation(): printername = conf['DEFAULT']['printername'] AcrobatReader = conf['DEFAULT']['AcrobatReader'] - clientsfile = os.path.join(IFPassdir, 'Clients_IFPass.csv') clientsbkpfile = os.path.join(IFPassdir, 'Clients_IFPass_backup.csv') imgdir = os.path.join(IFPassdir, 'Cartes') @@ -108,7 +107,7 @@ def getclientID(): def barcode_gen(clientID): print("Génération du code barre... ", end='') - barcode = code128.image(clientID, thickness=4) # .save(imgdir + clientID + '.png') + barcode = code128.image(clientID, thickness=4) # .save(imgdir + clientID + '.png') print(colored('[OK]', 'green')) return barcode @@ -161,7 +160,6 @@ def getpic(): picture = Image.fromarray(cropped) return picture - elif k & 0xFF == ord('q'): # Q or q to quit cv2.destroyAllWindows() sys.exit() @@ -186,21 +184,21 @@ def fillcard(barcode): # Name embedding : font = ImageFont.truetype(fonttemplate, 45) - draw.text((401, 310), fullname, fill=(0,0,0), font=font) + draw.text((401, 310), fullname, fill=(0, 0, 0), font=font) # Date embedding : font = ImageFont.truetype(fonttemplate, 30) - draw.text((401, 390), dateexp, fill=(0,0,0), font=font) + draw.text((401, 390), dateexp, fill=(0, 0, 0), font=font) # ID embedding : font = ImageFont.truetype('arial.ttf', 30) - draw.text((693, 560), clientID, fill=(0,0,0), font=font) + draw.text((693, 560), clientID, fill=(0, 0, 0), font=font) # Barcode + picture embedding : - im.paste(barcode,(556, 460)) + im.paste(barcode, (556, 460)) if version != 'devnocam': - im.paste(picture,(47, 49)) + im.paste(picture, (47, 49)) # Create PDF : im = im.convert("RGB") @@ -231,7 +229,7 @@ def mergepdf(): def printcard(cartefilename): # Working : subprocess.Popen('"C:\Program Files (x86)\Adobe\Acrobat Reader DC\Reader\AcroRd32.exe" /h /n /t ' + cartefilename + ' '+ printername, shell=False) - subprocess.Popen('"' + AcrobatReader + '"' + ' /h /n /t ' + cartefilename + ' '+ printername, shell=False) + subprocess.Popen('"' + AcrobatReader + '"' + ' /h /n /t ' + cartefilename + ' ' + printername, shell=False) def membersearch(): @@ -280,7 +278,7 @@ def membersearch(): if diff > 0: print(colored(f"L'abonnement est encore valable {diff} jours.", 'green', attrs=['bold'])) elif diff < 0: - print(colored("L'abonnement est expiré depuis {abs(diff)} jours.", 'red', attrs=['bold'])) # abs() to remove minus sign + print(colored("L'abonnement est expiré depuis {abs(diff)} jours.", 'red', attrs=['bold'])) # abs() to remove minus sign elif diff == 0: print(colored("Il s'agit du dernier jour de l'abonnement, il expirera demain.", 'yellow', attrs=['bold'])) From bf95073c2e00f78be15db1c23e5d101d9fb1f5c8 Mon Sep 17 00:00:00 2001 From: Jordan ERNST Date: Mon, 10 Dec 2018 16:53:53 +0100 Subject: [PATCH 5/6] Add MIT license --- LICENSE | 7 +++++++ 1 file changed, 7 insertions(+) create mode 100644 LICENSE diff --git a/LICENSE b/LICENSE new file mode 100644 index 0000000..a778ef6 --- /dev/null +++ b/LICENSE @@ -0,0 +1,7 @@ +Copyright © 2018 "Institut Français en Hongrie" + +Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. From ee8e741aaf4474600a44311409cad273d6f5b70b Mon Sep 17 00:00:00 2001 From: Jordan ERNST Date: Mon, 10 Dec 2018 17:06:38 +0100 Subject: [PATCH 6/6] Modified credits --- IFPass.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/IFPass.py b/IFPass.py index a50837b..a563a27 100644 --- a/IFPass.py +++ b/IFPass.py @@ -296,8 +296,8 @@ while "The program is running": print('Version : ', version) if version in ('dev', 'devnocam'): print(colored("\nATTENTION : Il s'agit d'une version en cours de développement, potentiellement instable !", 'red')) - print('\nLe programme IFPass à été écrit par Jordan ERNST Q1 2018.') - print('Pour toute question ou problème contactez-moi à pro.ernst@gmail.com.\n') + print("\nLe programme IFPass à été écrit par Jordan ERNST Q1 2018 pour l'Institut Français en Hongrie.") + print('Pour toute question, problème ou requête contactez-moi à pro.ernst@gmail.com.\n') print('1 - Nouveau membre', '2 - Rechercher un membre', '3 - Quitter', sep='\n') choix = input('Choix : ') if choix == '1':