Compare commits

...

102 Commits
v1.0 ... master

Author SHA1 Message Date
c18b49149f Add new builds 2019-06-20 16:39:50 +02:00
7016c2e665 Update version string 2019-06-20 16:32:26 +02:00
72d228de52 Update instructions in .cfg files 2019-06-20 16:31:44 +02:00
c31868d320 Update README to include build instructions 2019-06-20 16:30:58 +02:00
8a42245e4f Upgraded python and modules 2019-06-20 14:55:29 +02:00
655d61ea84 Merge branch 'dev' 2019-06-20 11:36:12 +02:00
b9561ef60f Del builds 2019-06-20 10:55:43 +02:00
962977774b Add licence information and link 2019-06-20 10:29:48 +02:00
0d94358f10 Print more informations about processing 2019-06-20 10:21:42 +02:00
461d969f92 Merge branch 'dev' 2019-04-02 17:22:49 +02:00
ff1a88c85b Fix print number of days since expired. 2019-04-02 17:22:06 +02:00
3e35e6fb05 New builds 2019-04-02 12:09:54 +02:00
48465446ec Increment version to 3.1-1 2019-04-02 12:05:21 +02:00
971bf846ab Merge branch 'dev' 2019-04-02 12:03:37 +02:00
d879cf389d Fixed bug change date 2019-04-02 12:03:07 +02:00
8138ebd95c Add builds 2019-03-25 09:49:35 +01:00
483d7e2f6f Fixed con files 2019-03-22 13:02:15 +01:00
e7f78e6e39 Increment version to 3.1 2019-03-22 12:51:33 +01:00
622ad63e0a Merge branch 'dev' 2019-03-22 12:27:09 +01:00
a93c05bcc3 Allow to choose date manually 2019-03-22 12:23:55 +01:00
029f0c1396 Update binaries to 3.0-1 2019-03-05 14:39:00 +01:00
e19a9b5820 Remove previous builds 2019-03-05 14:26:05 +01:00
7513a2d2fb Increment version to 3.0-1 2019-03-05 13:30:17 +01:00
dcb4caacc6 Correct bug print card 2019-03-05 13:29:37 +01:00
bb7d96e5e0 Include builds 2019-03-05 10:23:08 +01:00
32300d81e4 Updates depenencies 2019-03-05 10:16:37 +01:00
cf625f5398 Edit version 2019-03-05 09:42:57 +01:00
5cf50a04dd Merge branch 'dev' 2019-03-05 09:40:29 +01:00
ad2c7de563 Edit desc 2019-03-05 09:39:17 +01:00
9ab362fd29 Bugs corrections 2019-03-05 09:33:27 +01:00
5d76b1f584 Renew membership implementation + Multiple fixes. 2019-03-04 17:36:01 +01:00
a1beec5cd1 Fix various bugs 2019-03-01 15:19:40 +01:00
f3f86c43a6 Member edit implementation done. Recover previous picture added. 2019-03-01 14:52:13 +01:00
1dffdbeecd Added PyMuPDF dependency 2019-03-01 11:09:18 +01:00
a500e22678 Corrections 2019-02-28 16:31:11 +01:00
3dbb48d7fc Added modif line in writeindb() for member modification 2019-02-28 15:50:07 +01:00
d651a4973a Edit member ongoing 2019-02-28 09:25:06 +01:00
0ce5ed334c Code reformatting : function newmember() 2019-02-27 12:34:36 +01:00
d5c4ee5997 Name now on to lines. 2019-02-20 17:17:45 +01:00
56ea8c83bc Add exception .gitignore for builds 2019-02-20 15:04:06 +01:00
ad748edc81 Merge branch 'dev' 2019-02-08 12:41:42 +01:00
831097aa75 Catch exception when Templates not available. 2019-02-08 12:40:33 +01:00
07ec96d33a Bugs correction 2019-02-08 12:10:58 +01:00
66ae8f4196 updated installers version to 2.5 2019-02-08 11:50:23 +01:00
bf1f125da1 updated version to 2.5 2019-02-08 11:43:57 +01:00
da302a3cd5 Merge branch 'dev' 2019-02-08 11:40:33 +01:00
5db8255843 Moved conf in ProgramData and auto-detection Acrobat Reader. 2019-02-08 11:36:48 +01:00
6333ce531d created build.sh to build x86 and x64 2019-02-07 18:04:48 +01:00
7585d09f41 add distribution files in master 2019-02-07 17:54:26 +01:00
bc0ccd1c93 rm distribution files from dev 2019-02-07 17:34:41 +01:00
bf143c0021 Modified version 2019-02-07 16:51:27 +01:00
e57800daa2 Fixed templates move 2019-02-07 16:20:08 +01:00
d77465265c Adapted script for distribution 2019-02-07 15:54:04 +01:00
a758d36a08 Created required files for distribution 2019-02-07 15:17:56 +01:00
9201326eab Update .gitignore 2019-02-04 16:49:39 +01:00
23b3543ba9 Declared main() for packaging 2019-02-04 16:47:28 +01:00
36a4339172 Initial installer.cfg for packaging with pynsist 2019-02-04 15:47:55 +01:00
80d22ddcc1 Edit first line 2019-02-04 15:39:33 +01:00
e9db1fb9ee requirements.txt deleted 2019-02-04 15:28:13 +01:00
2c61943c9b Removed templates (private) 2018-12-13 11:35:57 +01:00
c53190144a Merge branch 'dev' 2018-12-13 11:31:55 +01:00
4767c6a872 Created Templates/README.md 2018-12-13 11:31:24 +01:00
0ae12b064f Edited .gitignore 2018-12-13 11:24:24 +01:00
f8bd1e24df Fixed typo in version 2018-12-13 11:17:48 +01:00
2b07399d7e Delete Clients_IFPass.csv 2018-12-13 09:45:56 +01:00
9432c6b1ba Delete Clients_IFPass.csv 2018-12-13 09:45:24 +01:00
a82cd9cdcc Merge branch 'dev' 2018-12-13 09:40:24 +01:00
4ea4134f11 Edit README.md 2018-12-13 09:40:12 +01:00
2de9729c1d Merge branch 'dev' 2018-12-13 09:35:12 +01:00
773697be7b Add README.md 2018-12-13 09:34:59 +01:00
462e3179f1 Merge dev (add LICENSE) 2018-12-13 09:11:10 +01:00
ee8e741aaf Modified credits 2018-12-10 17:06:38 +01:00
bf95073c2e Add MIT license 2018-12-10 16:53:53 +01:00
56d3b27ef9 Code formatting 2018-12-10 16:18:23 +01:00
437015589f requirements.txt created. INSTALL.txt deleted 2018-11-15 10:25:07 +01:00
6eadfa97df Updated INSTALL.txt 2018-11-14 16:00:43 +01:00
e1d09234e9 Moved pause after search 2018-04-25 17:31:38 +02:00
f53ede6c46 Edited version number 2018-04-25 17:16:28 +02:00
cbd21cf5fb Merge branch 'dev' 2018-04-25 17:15:02 +02:00
ef0057c1b3 Merge branch 'dev' of framagit.org:SecT0uch/IFPass into dev 2018-04-25 17:13:32 +02:00
1332350e4b Added break after printcard() to return menu 2018-04-25 17:08:45 +02:00
c7026ce9d3 Merge branch 'dev' 2018-04-25 16:51:33 +02:00
f1bc7d4fae Fix menu/banner affichage 2018-04-25 16:51:19 +02:00
d956ab621e v2.0 uploaded 2018-04-25 15:29:34 +02:00
0354a586a6 Removed CSV template 2018-04-25 14:55:41 +02:00
7dc3d229e9 Search function formatting - Check validity membership 2018-04-25 14:50:29 +02:00
f9b62fc805 search function added 2018-04-24 17:25:16 +02:00
5297fd2c5a Merge branch 'dev' into Member-Search 2018-04-24 15:48:01 +02:00
63c12029c4 .gitignore updated, untrack conf file 2018-04-24 15:17:00 +02:00
040e3e9033 .conf file writing added - devnocam mode added 2018-04-18 16:31:48 +02:00
09fd78f425 .conf file reading aded - beautify paths 2018-04-18 12:05:44 +02:00
13cfdf630c AutoGen db and Card dir 2018-04-17 16:27:41 +02:00
bc7482b29f Remove ignored files 2018-04-17 14:40:55 +02:00
7b23fe7b94 .gitignore updated, little fixes 2018-04-17 14:33:55 +02:00
29e35f5a0f CHANGELOG deleted (now available in Release tag) 2018-04-15 22:26:20 +02:00
9b562c2a70 CHANGELOG deleted (now available in Release tag) 2018-04-15 22:24:45 +02:00
18ae29bc21 Created CHANGELOG.md 2018-04-13 14:41:25 +02:00
cce390b365 Renamed README to INSTALL 2018-04-12 16:11:26 +02:00
aae57761ba Renamed README to INSTALL 2018-04-12 16:04:01 +02:00
6a6971b680 .gitignore added 2018-04-12 15:55:18 +02:00
9dae03073a IFPass dev files uploaded 2018-04-12 15:46:30 +02:00
46e18814a4 IFPass dev uploaded 2018-04-12 15:11:48 +02:00
19 changed files with 738 additions and 125 deletions

11
.gitignore vendored
View File

@ -1 +1,12 @@
.ropeproject
Cartes
Clients_IFPass.csv
Clients_IFPass_backup.csv
IFPass.conf
Templates/IFPass_PDF_Template.pdf
Templates/IFPass_PNG_Template.png
build/x86/*
build/x64/*
# Except builds:
!build/x86/*x86.exe
!build/x64/*x64.exe

View File

@ -1,3 +0,0 @@
## 1.0 (23/03/2018)
### First IFPass release

View File

@ -1 +0,0 @@
Titre;Prénom;Nom;Numéro de client;Date d'inscripton;Date d'expiration
1 Titre Prénom Nom Numéro de client Date d'inscripton Date d'expiration

View File

@ -1 +0,0 @@
Titre;Prénom;Nom;Numéro de client;Date d'inscripton;Date d'expiration
1 Titre Prénom Nom Numéro de client Date d'inscripton Date d'expiration

BIN
IF.ico Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.9 KiB

510
IFPass.py
View File

@ -1,16 +1,13 @@
#!/usr/bin/python3
#!python3
# Written by Jordan ERNST Q1 2018.
# Contact : pro.ernst@gmail.com
# v1.0 : 23/03/2018
# https://www.pyimagesearch.com/2015/12/21/increasing-webcam-fps-with-python-and-opencv/
import configparser
import sys
import os
import re
from contextlib import contextmanager # To hide output
from datetime import date, timedelta
from datetime import date, timedelta, datetime
import csv
import code128
import cv2
@ -18,57 +15,91 @@ from pywinauto.findwindows import find_window
from pywinauto.win32functions import SetForegroundWindow
from PIL import Image, ImageDraw, ImageFont
from PyPDF2 import PdfFileReader, PdfFileWriter
import fitz # = PyMuPDF : To convert pdf to png
import subprocess
from shutil import copyfile
from shutil import copyfile, move
from pyfiglet import Figlet
from colorama import init
from termcolor import colored
version = '1.0'
version = '3.2' # dev/devnocam
computer = '' # 'test', 'mediatheque' or 'accueil'
if computer == 'test':
IFPassdir = '\\\\192.168.1.1\SSIC\\04-Projets\IFPass\\'
elif computer == 'mediatheque':
IFPassdir = '\\\\192.168.1.1\IFPass\\'
printername = ' XPS Pink Card Printer'
elif computer == 'accueil':
IFPassdir = '\\\\192.168.1.1\IFPass\\'
printername = ' XPS Blue Card Printer'
else:
print('La variable "computer" est mal définie.')
sys.exit()
clientsfile = IFPassdir + 'Clients_IFPass.csv'
clientsbkpfile = IFPassdir + 'Clients_IFPass_bakup.csv'
imgdir = IFPassdir + 'Cartes\\'
pdftemplate = IFPassdir + 'Templates\IFPass_PDF_Template.pdf'
pngtemplate = IFPassdir + 'Templates\IFPass_PNG_Template.png'
fonttemplate = IFPassdir + 'Templates\Roboto-Bold.ttf'
configdir = os.path.join(os.getenv('PROGRAMDATA'), 'IFPass')
config = os.path.join(configdir, 'IFPass.conf')
@contextmanager
def HideOutput(to=os.devnull):
fd = sys.stdout.fileno()
def initialisation():
conf = configparser.ConfigParser()
conf.optionxform = str # For case sensitive config file
def _redirect_stdout(to):
sys.stdout.close() # + implicit flush()
os.dup2(to.fileno(), fd) # fd writes to 'to' file
sys.stdout = os.fdopen(fd, 'w') # Python writes to fd
if not os.path.exists(config): # Check if config file exists
print('Fichier de configuration introuvable.')
IFPassDBdir = input(r'Quel est le répertoire de la base de données IFPass ? (Ex : \\192.168.1.1\IFPass) : ')
printername = input("Quel est le nom de l'imprimante à cartes ? : ")
adobex86 = os.path.join(os.getenv('PROGRAMFILES(x86)'), 'Adobe', "Acrobat Reader DC", "Reader", "AcroRd32.exe")
adobex64 = os.path.join(os.getenv('PROGRAMFILES'), 'Adobe', "Acrobat Reader DC", "Reader", "AcroRd32.exe")
if os.path.exists(adobex86):
AcrobatReader = adobex86
elif os.path.exists(adobex64):
AcrobatReader = adobex64
else:
acrinstalled = yes_or_no("Acrobat Reader est nécessaire pour imprimer les cartes. Est il installé ?")
if acrinstalled:
while "Wrong path":
AcrobatReader = input(r"Quel est le chemin vers Acrobat Reader ? ( Ex : C:\Program Files (x86)\Adobe\Acrobat Reader DC\Reader\AcroRd32.exe) : ")
if os.path.exists(AcrobatReader):
break
else:
print(colored('\nChemin invalide !', 'red'))
else:
print(colored('\nInstallez Acrobat Reader, puis relancez IFPass.', 'red'))
os.system("pause")
sys.exit()
conf['DEFAULT'] = {'IFPassDBdir': IFPassDBdir, 'printername': printername, 'AcrobatReader': AcrobatReader}
os.makedirs(configdir, 0o777)
with open(config, 'w') as configfile:
conf.write(configfile)
else:
conf.read(config)
IFPassDBdir = conf['DEFAULT']['IFPassDBdir']
printername = conf['DEFAULT']['printername']
AcrobatReader = conf['DEFAULT']['AcrobatReader']
with os.fdopen(os.dup(fd), 'w') as old_stdout:
with open(to, 'w') as file:
_redirect_stdout(to=file)
try:
yield # allow code to be run with the redirected stdout
finally:
_redirect_stdout(to=old_stdout) # restore stdout. # cv2.selectROI
clientsfile = os.path.join(IFPassDBdir, 'Clients_IFPass.csv')
clientsbkpfile = os.path.join(IFPassDBdir, 'Clients_IFPass_backup.csv')
imgdir = os.path.join(IFPassDBdir, 'Cartes')
templatesdir = os.path.join(IFPassDBdir, 'Templates')
pdftemplate = os.path.join(templatesdir, 'IFPass_PDF_Template.pdf')
pngtemplate = os.path.join(templatesdir, 'IFPass_PNG_Template.png')
fonttemplate = os.path.join(templatesdir, 'Roboto-Bold.ttf')
if not os.path.exists(imgdir): # Cartes dir creation if it doesn't exist
os.makedirs(imgdir, 0o777)
if not os.path.exists(clientsfile): # Creation Clients_File if it doesn't exist
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"])
if not os.path.exists(templatesdir):
move('Templates', IFPassDBdir)
return IFPassDBdir, printername, AcrobatReader, clientsfile, clientsbkpfile, imgdir, templatesdir, pdftemplate, pngtemplate, fonttemplate
def get_fullname():
firstname = input("Prénom : ").strip()
def get_fullname(**kwargs): # **kwargs => Optionnal arguments
if 'firstname' in kwargs:
firstname = kwargs['firstname']
newfirstname = input("Prénom (" + firstname + "): ").strip()
if len(newfirstname) != 0:
firstname = newfirstname
else:
while "Empty firstname":
firstname = input("Prénom : ").strip()
if len(firstname) == 0:
os.system('cls')
print(colored("\nLe Prénom ne peut pas être vide.", 'red'))
else:
break
firstname = firstname[0].upper() + firstname[1:].lower()
if '-' in firstname:
pos = firstname.find("-")
@ -78,15 +109,29 @@ def get_fullname():
pos = firstname.find(" ")
firstname = firstname[:pos + 1] + firstname[pos + 1].upper() + \
firstname[pos + 2:] # Check if compound name
surname = input("Nom : ").upper().strip()
if 'surname' in kwargs:
surname = kwargs['surname']
newsurname = input("Nom (" + surname + "): ").strip()
if len(newsurname) != 0:
surname = newsurname
else:
while "Empty surname":
surname = input("Nom : ").strip()
if len(surname) == 0:
os.system('cls')
print(colored("\nLe Nom ne peut pas être vide.", 'red'))
else:
break
surname = surname.upper()
docteur = yes_or_no('Est-ce un Docteur ?')
if docteur:
titre = 'Dr.'
fullname = titre + ' ' + surname + ' ' + firstname
titrename = titre + ' ' + surname
else:
titre = ''
fullname = surname + ' ' + firstname
return titre, firstname, surname, fullname
titrename = surname
return titre, firstname, surname, titrename
def yes_or_no(question):
@ -107,13 +152,12 @@ def getclientID():
else:
clientID = str(int(lastID) + 1).zfill(10)
writeindb(clientID)
return clientID
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
@ -127,29 +171,29 @@ def getpic():
try:
ret, frame = cap.read()
cv2.rectangle(frame, (170, 73), (470, 407), (0, 255, 0), 2)
cv2.imshow('IFCamera - Touche Espace pour prendre la photo, Echap pour une carte sans photo, Q pour quitter.',
frame)
cv2.imshow('IFCamera - Touche Espace pour prendre la photo, Echap pour une carte sans photo, Q pour quitter.', frame)
except cv2.error:
print('\nLa webcam est débranchée. Branchez-la, puis relancez le programme.')
print(colored('\nLa webcam est débranchée. Branchez-la, puis relancez le programme.', 'red'))
os.system("pause")
sys.exit(0)
sys.exit()
SetForegroundWindow(find_window(title='IFCamera - Touche Espace '
'pour prendre la photo, Echap pour une carte sans photo, Q pour quitter.'))
k = cv2.waitKey(1)
if k == 27: # Echap
cap.release()
print(colored('[OK]', 'green'))
cv2.destroyAllWindows()
defaultpicture = IFPassdir + 'Templates\default_avatar.jpg'
defaultpicture = os.path.join(IFPassDBdir, 'Templates', 'default_avatar.jpg')
picture = Image.open(defaultpicture)
return picture
elif k & 0xFF == ord(' '): # Space
cap.release()
cv2.destroyAllWindows()
break
elif k & 0xFF == ord('q'): # Q or q to quit
cap.release()
cv2.destroyAllWindows()
sys.exit()
cap.release()
cv2.destroyAllWindows()
cropped = frame[75:405, 172:468]
cv2.imshow('IFCamera - Espace pour valider, Echap pour modifier, Q pour quitter', cropped)
while True:
@ -167,44 +211,73 @@ def getpic():
picture = Image.fromarray(cropped)
return picture
elif k & 0xFF == ord('q'): # Q or q to quit
cv2.destroyAllWindows()
sys.exit()
def writeindb(clientID):
print("Ajout dans la base de données... ", end="")
with open(clientsfile, 'a', newline='', encoding='utf-8') as csvfile:
writer = csv.writer(csvfile, delimiter=';')
writer.writerow([titre, firstname, surname, clientID, dateinsc, dateexp])
print(colored('[OK]', 'green'))
def writeindb(titre, firstname, surname, clientID, dateinsc, dateexp, new):
if new is True:
print("Ajout dans la base de données... ", end="")
with open(clientsfile, 'a', newline='', encoding='utf-8') as csvfile:
writer = csv.writer(csvfile, delimiter=';')
writer.writerow([titre, firstname, surname, clientID, dateinsc, dateexp])
print(colored('[OK]', 'green'))
elif new is False:
print("Modification de la base de données... ", end="")
with open(clientsfile, 'r+', newline='', encoding='utf-8') as csvfile:
content = csvfile.readlines()
for index, member in enumerate(content):
member = member.split(';')
if member[3] == clientID:
tochange = index
break
content.pop(tochange)
changewith = ";".join([titre, firstname, surname, clientID, dateinsc, dateexp]) + '\n'
content.insert(tochange, changewith)
content = "".join(content)
csvfile.seek(0)
csvfile.truncate(0)
csvfile.write(content)
print(colored('[OK]', 'green'))
def bkpdb():
copyfile(clientsfile, clientsbkpfile)
def fillcard(barcode):
print("Création de la carte avec les informations...", end='')
im = Image.open(pngtemplate)
def fillcard(clientID, titrename, firstname, dateexp, barcode, picture):
print("Création du verso de la carte avec les informations...", end='')
try:
im = Image.open(pngtemplate)
except FileNotFoundError:
os.system('cls')
print(colored('Vous avez besoin de 2 fichiers dans le dossier Templates pour générer des cartes :', 'red'))
print(templatesdir + '\\IFPass_PDF_Template.pdf : Modèle de la carte (recto et verso)')
print(templatesdir + '\\IFPass_PNG_Template.png : La face avant de la carte (celle à remplir)')
os.system("pause")
sys.exit()
draw = ImageDraw.Draw(im)
# Name embedding :
font = ImageFont.truetype(fonttemplate, 45)
draw.text((401, 310), fullname, fill=(0,0,0), font=font)
font = ImageFont.truetype(fonttemplate, 40)
draw.text((401, 296), titrename, fill=(0, 0, 0), font=font)
draw.text((401, 334), firstname, 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, 400), 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(picture,(47, 49))
im.paste(barcode, (556, 460))
if version != 'devnocam':
im.paste(picture, (47, 49))
# Create PDF :
im = im.convert("RGB")
@ -213,8 +286,9 @@ def fillcard(barcode):
print(colored('[OK]', 'green'))
def mergepdf():
cartefilename = imgdir + clientID + '.pdf'
def mergepdf(clientID):
print("Fusion du recto et du verso de la carte...", end='')
cartefilename = os.path.join(imgdir, clientID + '.pdf')
output = PdfFileWriter()
pdf1 = PdfFileReader(imgdir + clientID + '_Front.pdf', 'rb')
@ -229,55 +303,261 @@ def mergepdf():
output.write(f)
os.remove(imgdir + clientID + '_Front.pdf')
print(colored('[OK]', 'green'))
return cartefilename
def printcard(cartefilename):
# CMD : "C:\Program Files (x86)\Adobe\Acrobat Reader DC\Reader\AcroRd32.exe" /h /n /t Carte.pdf "XPS Pink Card Printer"
subprocess.Popen('"C:\Program Files (x86)\Adobe\Acrobat Reader DC\Reader\AcroRd32.exe" /h /n /t ' + cartefilename + printername, shell=False)
print('test')
# 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)
while "the informations are incorrect": # Loop Filling informations
os.system('cls')
init()
f = Figlet(font='big')
print(colored(f.renderText('IFPass'), 'cyan', attrs=['bold']))
print('Version :', version)
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')
titre, firstname, surname, fullname = get_fullname()
dateinsc = date.today()
dateexp = dateinsc + timedelta(days=365)
def getdateexp():
while True:
dateexp = input("Quelle date d'expiration voulez-vous mettre (Format : JJ/MM/AAAA)? : ")
match = re.fullmatch(r'^(0[1-9]|1[0-9]|2[0-9]|3[0-1])/(0[1-9]|1[0-2])/([0-9]){4}$', dateexp)
if match:
break
else:
print('Mauvais format ! JJ/MM/AAAA, exemple : 01/08/2042')
return dateexp
dateinsc = dateinsc.strftime('%d/%m/%Y')
dateexp = dateexp.strftime('%d/%m/%Y')
changeexp = yes_or_no('Voulez-vous choisir la date d\'expiration ?')
if changeexp:
while True:
dateexp = input('Quelle date d\'expiration voulez-vous mettre (Format : JJ/MM/AAAA)? : ')
match = re.fullmatch(r'^(0[1-9]|1[0-9]|2[0-9]|3[0-1])/(0[1-9]|1[0-2])/([0-9]){4}$', dateexp)
if match:
break
else:
print('Mauvais format ! JJ/MM/AAAA, exemple : 01/08/2042')
os.system('cls')
print("Titre : ", colored(titre, 'green'))
print("Prénom : ", colored(firstname, 'green'))
print("Nom : ", colored(surname, 'green'))
print("Date d'inscription :", colored(dateinsc, 'green'))
print("Date d'expiration : ", colored(dateexp, 'green'))
correct = yes_or_no("Ces informations sont elles correctes ?")
if correct:
def newmember():
while "the informations are incorrect": # Loop Filling informations
os.system('cls')
picture = getpic()
clientID = getclientID()
titre, firstname, surname, titrename = get_fullname()
dateinsc = date.today()
dateexp = dateinsc + timedelta(days=365)
dateinsc = dateinsc.strftime('%d/%m/%Y')
dateexp = dateexp.strftime('%d/%m/%Y')
changeexp = yes_or_no("Voulez-vous choisir la date d'expiration ?")
if changeexp:
dateexp = getdateexp()
os.system('cls')
print("Titre : ", colored(titre, 'green'))
print("Prénom : ", colored(firstname, 'green'))
print("Nom : ", colored(surname, 'green'))
print("Date d'inscription :", colored(dateinsc, 'green'))
print("Date d'expiration : ", colored(dateexp, 'green'))
correct = yes_or_no("Ces informations sont elles correctes ?")
if correct:
os.system('cls')
if version != 'devnocam':
picture = getpic()
clientID = getclientID()
barcode = barcode_gen(clientID)
fillcard(clientID, titrename, firstname, dateexp, barcode, picture)
cartefilename = mergepdf(clientID)
if version not in ('dev', 'devnocam'):
bkpdb()
printcard(cartefilename)
writeindb(titre, firstname, surname, clientID, dateinsc, dateexp, new=True)
break
def membersearch():
with open(clientsfile, 'r', newline='', encoding='utf-8') as csvfile:
reader = csv.reader(csvfile, delimiter=';')
csvlist = list(map(list, reader))
del csvlist[0] # We dele the first line (Prénom, Nom...)
research = input('Entrez une partie du nom, prénom, ou numéro de carte (ou flashez) : ').lower()
os.system('cls')
results = []
for member in csvlist:
resfirstname = member[1].lower()
ressurname = member[2].lower()
resnumber = member[3]
if any(research in data for data in [resfirstname, ressurname, resnumber]):
results.append(member)
if results:
if len(results) == 1:
member = results[0]
else:
print('-' * 56)
print(f'{"Choix":8} {"Prénom":15} {"Nom":15} {"Numéro de carte":15}')
print('-' * 56)
for index, result in enumerate(results, start=1):
print(f'{index:^8} {result[1]:15} {result[2]:15} {result[3]:^15}')
del member
while 'The choice is not valid':
try:
memberchoice = input("De quel membre s'agit il ? (Colonne Choix) : ")
member = results[int(memberchoice) - 1]
break
except (IndexError, ValueError):
print(colored('Choix invalide ! Veillez bien à sélectionner le numéro de la colonne "Choix"', 'red', attrs=['bold']))
os.system('cls')
while 'Choix incorect':
print("Titre : ", colored(member[0], 'green'))
print("Prénom : ", colored(member[1], 'green'))
print("Nom : ", colored(member[2], 'green'))
print("Numéro de carte : ", colored(member[3], 'green'))
print("Date d'inscription :", member[4])
print("Date d'expiration : ", member[5])
dateexp = datetime.strptime(member[5], '%d/%m/%Y').date()
diff = (dateexp - date.today()).days
if diff > 0:
print(colored(f"L'abonnement est encore valable {diff} jours.", 'green', attrs=['bold']))
elif diff < 0:
print(colored(f"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']))
print('\n1 - Modifier', "2 - Renouveller l'abonnement / Choisir un nouvelle date d'expiration", '3 - Imprimer la carte', '0 - Menu principal', sep='\n')
choix = input('Choix : ')
if choix == '0':
os.system('cls')
return
# We update values with new (edited) values :
newtitre, newfirstname, newsurname, newdateexp = memberdo(choix, member)
member[0], member[1], member[2], member[5] = newtitre, newfirstname, newsurname, newdateexp
else:
print(colored("Aucun membre n'a été trouvé.", 'red', attrs=['bold']))
os.system("pause")
def memberdo(choix, member):
titre = member[0]
firstname = member[1]
surname = member[2]
clientID = member[3]
dateinsc = member[4]
dateexp = member[5]
os.system('cls')
if choix == '1': # Edit member
titre, firstname, surname, dateexp = memberedit(titre, firstname, surname, clientID, dateinsc, dateexp)
elif choix == '2': # Renew subscription
changeexp = yes_or_no("Voulez-vous choisir la date d'expiration ?")
if changeexp:
dateexp = getdateexp()
else:
dateexp = datetime.strptime(dateexp, '%d/%m/%Y').date()
diff = (dateexp - date.today()).days
if diff >= 0:
dateexp = dateexp + timedelta(days=365)
elif diff < 0:
dateexp = date.today() + timedelta(days=365)
dateexp = dateexp.strftime('%d/%m/%Y')
if titre == 'Dr.':
titrename = titre + ' ' + surname
else:
titrename = surname
wantnewpic = yes_or_no("Voulez-vous prendre une nouvelle photo ?")
os.system('cls')
if wantnewpic:
os.system('cls')
if version != 'devnocam':
picture = getpic()
else:
# We crop pic from the previous card
cartefilename = os.path.join(imgdir, clientID + '.pdf')
pdf = fitz.open(cartefilename)
page = pdf.loadPage(0)
mat = fitz.Matrix(4.165, 4.165) # To obtain good resolution
pix = page.getPixmap(matrix=mat)
pageimg = Image.frombytes("RGBA", [pix.width, pix.height], pix.samples)
picture = pageimg.crop((47, 49, 343, 378))
barcode = barcode_gen(clientID)
fillcard(barcode)
cartefilename = mergepdf()
bkpdb()
if computer == 'mediatheque' or computer == 'accueil':
fillcard(clientID, titrename, firstname, dateexp, barcode, picture)
cartefilename = mergepdf(clientID)
if version not in ('dev', 'devnocam'):
bkpdb()
printcard(cartefilename)
writeindb(titre, firstname, surname, clientID, dateinsc, dateexp, new=False)
os.system('cls')
print(colored("La date d'expiration a bien été mise à jour !\n", 'blue', attrs=['bold']))
elif choix == '3': # Print card
cartefilename = os.path.join(imgdir, clientID + '.pdf')
printcard(cartefilename)
else:
print(colored('Choix incorrect !\n', 'red', attrs=['bold']))
return titre, firstname, surname, dateexp
def memberedit(titre, firstname, surname, clientID, dateinsc, dateexp):
while "the informations are incorrect": # Loop Filling informations
titre, firstname, surname, titrename = get_fullname(titre=titre, firstname=firstname, surname=surname)
print("Titre : ", colored(titre, 'green'))
print("Prénom : ", colored(firstname, 'green'))
print("Nom : ", colored(surname, 'green'))
correct = yes_or_no("Ces informations sont elles correctes ?")
os.system('cls')
if correct:
wantnewpic = yes_or_no("Voulez-vous prendre une nouvelle photo ?")
os.system('cls')
if wantnewpic:
os.system('cls')
if version != 'devnocam':
picture = getpic()
else:
# We crop pic from the previous card
cartefilename = os.path.join(imgdir, clientID + '.pdf')
pdf = fitz.open(cartefilename)
page = pdf.loadPage(0)
mat = fitz.Matrix(4.165, 4.165) # To obtain good resolution
pix = page.getPixmap(matrix=mat)
pageimg = Image.frombytes("RGBA", [pix.width, pix.height], pix.samples)
picture = pageimg.crop((47, 49, 343, 378))
barcode = barcode_gen(clientID)
fillcard(clientID, titrename, firstname, dateexp, barcode, picture)
cartefilename = mergepdf(clientID)
if version not in ('dev', 'devnocam'):
bkpdb()
printcard(cartefilename)
writeindb(titre, firstname, surname, clientID, dateinsc, dateexp, new=False)
os.system('cls')
break
return titre, firstname, surname, dateexp
def main():
global IFPassDBdir, clientsfile, imgdir, clientsbkpfile, templatesdir, pngtemplate, fonttemplate, pdftemplate, printername, AcrobatReader
while "The program is running":
init() # Initialisation of colorama
IFPassDBdir, printername, AcrobatReader, clientsfile, clientsbkpfile, imgdir, templatesdir, pdftemplate, pngtemplate, fonttemplate = initialisation()
os.system('cls')
f = Figlet(font='big')
print(colored(f.renderText('IFPass'), 'cyan', attrs=['bold']))
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("\nCe programme est developpé par par Jordan ERNST pour l'Institut Français en Hongrie.")
print("Il est disponible sou licence MIT à cette addresse : https://framagit.org/SecT0uch/IFPass\n")
print('Pour toute question, problème ou requête contactez-moi à pro.ernst@gmail.com.\n')
print('1 - Nouveau membre', '2 - Rechercher un membre', '0 - Quitter', sep='\n')
choix = input('Choix : ')
if choix == '1':
newmember()
elif choix == '2':
os.system('cls')
membersearch()
elif choix == '0':
sys.exit()
else:
os.system('cls')
print(colored('Choix incorrect !', 'red', attrs=['bold']))

View File

@ -1,5 +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
-Téléchargez (cp36 pour Python 3.6) : https://www.lfd.uci.edu/~gohlke/pythonlibs/#opencv
-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

189
Installer_Template.nsi Normal file
View File

@ -0,0 +1,189 @@
!define PRODUCT_NAME "[[ib.appname]]"
!define PRODUCT_VERSION "[[ib.version]]"
!define PY_VERSION "[[ib.py_version]]"
!define PY_MAJOR_VERSION "[[ib.py_major_version]]"
!define BITNESS "[[ib.py_bitness]]"
!define ARCH_TAG "[[arch_tag]]"
!define INSTALLER_NAME "[[ib.installer_name]]"
!define PRODUCT_ICON "[[icon]]"
; Marker file to tell the uninstaller that it's a user installation
!define USER_INSTALL_MARKER _user_install_marker
Unicode true
InstallDir "C:\IFPass"
SetCompressor lzma
[% block modernui %]
; Modern UI installer stuff
!include "MUI2.nsh"
!define MUI_ABORTWARNING
!define MUI_ICON "[[icon]]"
!define MUI_UNICON "[[icon]]"
; UI pages
[% block ui_pages %]
!insertmacro MUI_PAGE_WELCOME
[% if license_file %]
!insertmacro MUI_PAGE_LICENSE [[license_file]]
[% endif %]
!insertmacro MUI_PAGE_INSTFILES
!insertmacro MUI_PAGE_FINISH
[% endblock ui_pages %]
!insertmacro MUI_LANGUAGE "French"
[% endblock modernui %]
Name "${PRODUCT_NAME} ${PRODUCT_VERSION}"
OutFile "${INSTALLER_NAME}"
ShowInstDetails show
Section -SETTINGS
SetOutPath "$INSTDIR"
SetOverwrite ifnewer
SectionEnd
[% block sections %]
Section "!${PRODUCT_NAME}" sec_app
SetRegView [[ib.py_bitness]]
SetShellVarContext all
SectionIn RO
File ${PRODUCT_ICON}
SetOutPath "$INSTDIR\pkgs"
File /r "pkgs\*.*"
SetOutPath "$INSTDIR"
[% block install_files %]
; Install files
[% for destination, group in grouped_files %]
SetOutPath "[[destination]]"
[% for file in group %]
File "[[ file ]]"
[% endfor %]
[% endfor %]
; Install directories
[% for dir, destination in ib.install_dirs %]
SetOutPath "[[ pjoin(destination, dir) ]]"
File /r "[[dir]]\*.*"
[% endfor %]
[% endblock install_files %]
[% block install_shortcuts %]
; Install shortcuts
; The output path becomes the working directory for shortcuts
SetOutPath "$INSTDIR"
[% if single_shortcut %]
[% for scname, sc in ib.shortcuts.items() %]
CreateShortCut "$SMPROGRAMS\[[scname]].lnk" "[[sc['target'] ]]" \
'[[ sc['parameters'] ]]' "$INSTDIR\[[ sc['icon'] ]]"
CreateShortCut "$DESKTOP\[[scname]].lnk" "[[sc['target'] ]]" \
'[[ sc['parameters'] ]]' "$INSTDIR\[[ sc['icon'] ]]"
[% endfor %]
[% else %]
[# Multiple shortcuts: create a directory for them #]
CreateDirectory "$SMPROGRAMS\${PRODUCT_NAME}"
[% for scname, sc in ib.shortcuts.items() %]
CreateShortCut "$SMPROGRAMS\${PRODUCT_NAME}\[[scname]].lnk" "[[sc['target'] ]]" \
'[[ sc['parameters'] ]]' "$INSTDIR\[[ sc['icon'] ]]"
[% endfor %]
[% endif %]
SetOutPath "$INSTDIR"
[% endblock install_shortcuts %]
[% block install_commands %]
[% if has_commands %]
DetailPrint "Setting up command-line launchers..."
nsExec::ExecToLog '[[ python ]] -Es "$INSTDIR\_assemble_launchers.py" "$INSTDIR\bin"'
[% endif %]
[% endblock install_commands %]
; Byte-compile Python files.
DetailPrint "Byte-compiling Python modules..."
nsExec::ExecToLog '[[ python ]] -m compileall -q "$INSTDIR\pkgs"'
WriteUninstaller $INSTDIR\uninstall.exe
; Add ourselves to Add/remove programs
WriteRegStr SHCTX "Software\Microsoft\Windows\CurrentVersion\Uninstall\${PRODUCT_NAME}" \
"DisplayName" "${PRODUCT_NAME}"
WriteRegStr SHCTX "Software\Microsoft\Windows\CurrentVersion\Uninstall\${PRODUCT_NAME}" \
"UninstallString" '"$INSTDIR\uninstall.exe"'
WriteRegStr SHCTX "Software\Microsoft\Windows\CurrentVersion\Uninstall\${PRODUCT_NAME}" \
"InstallLocation" "$INSTDIR"
WriteRegStr SHCTX "Software\Microsoft\Windows\CurrentVersion\Uninstall\${PRODUCT_NAME}" \
"DisplayIcon" "$INSTDIR\${PRODUCT_ICON}"
[% if ib.publisher is not none %]
WriteRegStr SHCTX "Software\Microsoft\Windows\CurrentVersion\Uninstall\${PRODUCT_NAME}" \
"Publisher" "[[ib.publisher]]"
[% endif %]
WriteRegStr SHCTX "Software\Microsoft\Windows\CurrentVersion\Uninstall\${PRODUCT_NAME}" \
"DisplayVersion" "${PRODUCT_VERSION}"
WriteRegDWORD SHCTX "Software\Microsoft\Windows\CurrentVersion\Uninstall\${PRODUCT_NAME}" \
"NoModify" 1
WriteRegDWORD SHCTX "Software\Microsoft\Windows\CurrentVersion\Uninstall\${PRODUCT_NAME}" \
"NoRepair" 1
; Check if we need to reboot
IfRebootFlag 0 noreboot
MessageBox MB_YESNO "A reboot is required to finish the installation. Do you wish to reboot now?" \
/SD IDNO IDNO noreboot
Reboot
noreboot:
SectionEnd
Section "Uninstall"
SetRegView [[ib.py_bitness]]
SetShellVarContext all
Delete $INSTDIR\uninstall.exe
Delete "$INSTDIR\${PRODUCT_ICON}"
RMDir /r "$INSTDIR\pkgs"
; Remove ourselves from %PATH%
[% block uninstall_commands %]
[% if has_commands %]
nsExec::ExecToLog '[[ python ]] -Es "$INSTDIR\_system_path.py" remove "$INSTDIR\bin"'
[% endif %]
[% endblock uninstall_commands %]
[% block uninstall_files %]
; Uninstall files
[% for file, destination in ib.install_files %]
Delete "[[pjoin(destination, file)]]"
[% endfor %]
; Uninstall directories
[% for dir, destination in ib.install_dirs %]
RMDir /r "[[pjoin(destination, dir)]]"
[% endfor %]
[% endblock uninstall_files %]
[% block uninstall_shortcuts %]
; Uninstall shortcuts
[% if single_shortcut %]
[% for scname in ib.shortcuts %]
Delete "$SMPROGRAMS\[[scname]].lnk"
Delete "$DESKTOP\[[scname]].lnk"
[% endfor %]
[% else %]
RMDir /r "$SMPROGRAMS\${PRODUCT_NAME}"
[% endif %]
[% endblock uninstall_shortcuts %]
RMDir $INSTDIR
DeleteRegKey SHCTX "Software\Microsoft\Windows\CurrentVersion\Uninstall\${PRODUCT_NAME}"
SectionEnd
[% endblock sections %]
; Functions
Function .onMouseOverSection
; Find which section the mouse is over, and set the corresponding description.
FindWindow $R0 "#32770" "" $HWNDPARENT
GetDlgItem $R0 $R0 1043 ; description item (must be added to the UI)
[% block mouseover_messages %]
StrCmp $0 ${sec_app} "" +2
SendMessage $R0 ${WM_SETTEXT} 0 "STR:${PRODUCT_NAME}"
[% endblock mouseover_messages %]
FunctionEnd

7
LICENSE Normal file
View File

@ -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.

12
README.md Normal file
View File

@ -0,0 +1,12 @@
# IFPass
IFPass is a python project developped for the "Institut Français en Hongrie" and published under [MIT license](https://framagit.org/SecT0uch/IFPass/blob/master/LICENSE).
It allows to manage a subscriber database and print member cards.
## Build
1. Install [NSIS](http://nsis.sourceforge.net/Download).
2. Install python 3 and pip.
3. Install the modules with `sudo -H pip install pynsist PyPDF2 termcolor`
4. If pynsist version < 2.4, replace `/usr/lib/python3.*/site-packages/nsist/__init__.py` with https://raw.githubusercontent.com/takluyver/pynsist/master/nsist/__init__.py
5. Run `./build.sh`

Binary file not shown.

Binary file not shown.

Before

Width:  |  Height:  |  Size: 24 KiB

3
Templates/README.md Normal file
View File

@ -0,0 +1,3 @@
Here you need two files :
* IFPass_PDF_Template.pdf : Template of the card (both sides)
* IFPass_PNG_Template.png : First side of the card (the one to fill up)

Binary file not shown.

3
build.sh Normal file
View File

@ -0,0 +1,3 @@
#!/usr/bin/bash
pynsist installer-x86.cfg
pynsist installer-x64.cfg

Binary file not shown.

Binary file not shown.

59
installer-x64.cfg Normal file
View File

@ -0,0 +1,59 @@
[Application]
name=IFPass
version=3.2
entry_point=IFPass:main
icon=IF.ico
console=true
license_file=LICENSE
[Python]
version=3.7.3
bitness=64
[Include]
# Packages from PyPI that your application requires, one per line
# These must have wheels on PyPI:
# https://pypi.org/project/code128/
# https://pypi.org/project/colorama/
# https://pypi.org/project/pyfiglet/
# https://pypi.org/project/numpy/
# https://pypi.org/project/opencv-python/
# https://pypi.org/project/Pillow/
# https://pypi.org/project/pywin32/
# https://pypi.org/project/six/
# https://pypi.org/project/setuptools/
# https://pypi.org/project/PyMuPDF/
# https://pypi.org/project/pywinauto/
pypi_wheels=code128==0.3
colorama==0.4.1
pyfiglet==0.8.post1
numpy==1.16.4
opencv-python==4.1.0.25
Pillow==6.0.0
pywin32==224
six==1.12.0
setuptools==41.0.1
PyMuPDF==1.14.16
pywinauto==0.6.6
# Must check if future updates of the following packages provide .whl files
# Packages without wheels (Must be installed locally):
packages=PyPDF2
termcolor
# Other files and folders that should be installed
files = LICENSE
Templates
# This optional section adds a command which can be run from the Windows
# command prompt.
[Command IFPass]
entry_point=IFPass:main
[Build]
directory=build/x64
installer_name=${PRODUCT_NAME}_${PRODUCT_VERSION}-x64.exe
# Custom Installer :
# Added Desktop shortcut, modified working directory, modified default install and utf-8...
nsi_template=Installer_Template.nsi

59
installer-x86.cfg Normal file
View File

@ -0,0 +1,59 @@
[Application]
name=IFPass
version=3.2
entry_point=IFPass:main
icon=IF.ico
console=true
license_file=LICENSE
[Python]
version=3.7.3
bitness=32
[Include]
# Packages from PyPI that your application requires, one per line
# These must have wheels on PyPI:
# https://pypi.org/project/code128/
# https://pypi.org/project/colorama/
# https://pypi.org/project/pyfiglet/
# https://pypi.org/project/numpy/
# https://pypi.org/project/opencv-python/
# https://pypi.org/project/Pillow/
# https://pypi.org/project/pywin32/
# https://pypi.org/project/six/
# https://pypi.org/project/setuptools/
# https://pypi.org/project/PyMuPDF/
# https://pypi.org/project/pywinauto/
pypi_wheels=code128==0.3
colorama==0.4.1
pyfiglet==0.8.post1
numpy==1.16.4
opencv-python==4.1.0.25
Pillow==6.0.0
pywin32==224
six==1.12.0
setuptools==41.0.1
PyMuPDF==1.14.16
pywinauto==0.6.6
# Must check if future updates of the following packages provide .whl files
# Packages without wheels (Must be installed locally):
packages=PyPDF2
termcolor
# Other files and folders that should be installed
files = LICENSE
Templates
# This optional section adds a command which can be run from the Windows
# command prompt.
[Command IFPass]
entry_point=IFPass:main
[Build]
directory=build/x86
installer_name=${PRODUCT_NAME}_${PRODUCT_VERSION}-x86.exe
# Custom Installer :
# Added Desktop shortcut, modified working directory, modified default install and utf-8...
nsi_template=Installer_Template.nsi