Compare commits
15 Commits
Author | SHA1 | Date | |
---|---|---|---|
c18b49149f | |||
7016c2e665 | |||
72d228de52 | |||
c31868d320 | |||
8a42245e4f | |||
655d61ea84 | |||
b9561ef60f | |||
962977774b | |||
0d94358f10 | |||
461d969f92 | |||
ff1a88c85b | |||
3e35e6fb05 | |||
48465446ec | |||
971bf846ab | |||
d879cf389d |
18
IFPass.py
18
IFPass.py
@ -23,7 +23,7 @@ from colorama import init
|
||||
from termcolor import colored
|
||||
|
||||
|
||||
version = '3.1' # dev/devnocam
|
||||
version = '3.2' # dev/devnocam
|
||||
|
||||
configdir = os.path.join(os.getenv('PROGRAMDATA'), 'IFPass')
|
||||
config = os.path.join(configdir, 'IFPass.conf')
|
||||
@ -248,7 +248,7 @@ def bkpdb():
|
||||
|
||||
|
||||
def fillcard(clientID, titrename, firstname, dateexp, barcode, picture):
|
||||
print("Création de la carte avec les informations...", end='')
|
||||
print("Création du verso de la carte avec les informations...", end='')
|
||||
try:
|
||||
im = Image.open(pngtemplate)
|
||||
except FileNotFoundError:
|
||||
@ -287,6 +287,7 @@ def fillcard(clientID, titrename, firstname, dateexp, barcode, picture):
|
||||
|
||||
|
||||
def mergepdf(clientID):
|
||||
print("Fusion du recto et du verso de la carte...", end='')
|
||||
cartefilename = os.path.join(imgdir, clientID + '.pdf')
|
||||
output = PdfFileWriter()
|
||||
|
||||
@ -302,6 +303,7 @@ def mergepdf(clientID):
|
||||
output.write(f)
|
||||
|
||||
os.remove(imgdir + clientID + '_Front.pdf')
|
||||
print(colored('[OK]', 'green'))
|
||||
|
||||
return cartefilename
|
||||
|
||||
@ -405,7 +407,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(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']))
|
||||
|
||||
@ -436,9 +438,10 @@ def memberdo(choix, member):
|
||||
titre, firstname, surname, dateexp = memberedit(titre, firstname, surname, clientID, dateinsc, dateexp)
|
||||
|
||||
elif choix == '2': # Renew subscription
|
||||
print("1 - Renouveller l'abonnement automatiquement", "2 - Choisir la date d'expiration", sep='\n')
|
||||
choix = input("Choix : ")
|
||||
if choix == 1:
|
||||
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:
|
||||
@ -446,8 +449,6 @@ def memberdo(choix, member):
|
||||
elif diff < 0:
|
||||
dateexp = date.today() + timedelta(days=365)
|
||||
dateexp = dateexp.strftime('%d/%m/%Y')
|
||||
elif choix == 2:
|
||||
dateexp = getdateexp()
|
||||
|
||||
if titre == 'Dr.':
|
||||
titrename = titre + ' ' + surname
|
||||
@ -543,6 +544,7 @@ def main():
|
||||
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 : ')
|
||||
|
10
README.md
10
README.md
@ -1,4 +1,12 @@
|
||||
# IFPass
|
||||
|
||||
IFPass is a python project developped for the "Institut Français en Hongrie" and published under MIT license.
|
||||
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.
@ -1,13 +1,13 @@
|
||||
[Application]
|
||||
name=IFPass
|
||||
version=3.1
|
||||
version=3.2
|
||||
entry_point=IFPass:main
|
||||
icon=IF.ico
|
||||
console=true
|
||||
license_file=LICENSE
|
||||
|
||||
[Python]
|
||||
version=3.7.1
|
||||
version=3.7.3
|
||||
bitness=64
|
||||
|
||||
[Include]
|
||||
@ -28,16 +28,16 @@ bitness=64
|
||||
pypi_wheels=code128==0.3
|
||||
colorama==0.4.1
|
||||
pyfiglet==0.8.post1
|
||||
numpy==1.16.2
|
||||
opencv-python==4.0.0.21
|
||||
Pillow==5.4.1
|
||||
numpy==1.16.4
|
||||
opencv-python==4.1.0.25
|
||||
Pillow==6.0.0
|
||||
pywin32==224
|
||||
six==1.12.0
|
||||
setuptools==40.8.0
|
||||
PyMuPDF==1.14.12
|
||||
setuptools==41.0.1
|
||||
PyMuPDF==1.14.16
|
||||
pywinauto==0.6.6
|
||||
|
||||
# Must check if future updates of the following packages provide .whl files
|
||||
# pywinauto needs to be downloaded manually and edit setup to match platform=win32
|
||||
# Packages without wheels (Must be installed locally):
|
||||
packages=PyPDF2
|
||||
termcolor
|
||||
|
@ -1,13 +1,13 @@
|
||||
[Application]
|
||||
name=IFPass
|
||||
version=3.1
|
||||
version=3.2
|
||||
entry_point=IFPass:main
|
||||
icon=IF.ico
|
||||
console=true
|
||||
license_file=LICENSE
|
||||
|
||||
[Python]
|
||||
version=3.7.1
|
||||
version=3.7.3
|
||||
bitness=32
|
||||
|
||||
[Include]
|
||||
@ -28,16 +28,16 @@ bitness=32
|
||||
pypi_wheels=code128==0.3
|
||||
colorama==0.4.1
|
||||
pyfiglet==0.8.post1
|
||||
numpy==1.16.2
|
||||
opencv-python==4.0.0.21
|
||||
Pillow==5.4.1
|
||||
numpy==1.16.4
|
||||
opencv-python==4.1.0.25
|
||||
Pillow==6.0.0
|
||||
pywin32==224
|
||||
six==1.12.0
|
||||
setuptools==40.8.0
|
||||
PyMuPDF==1.14.12
|
||||
setuptools==41.0.1
|
||||
PyMuPDF==1.14.16
|
||||
pywinauto==0.6.6
|
||||
|
||||
# Must check if future updates of the following packages provide .whl files
|
||||
# pywinauto needs to be downloaded manually and edit setup to match platform=win32
|
||||
# Packages without wheels (Must be installed locally):
|
||||
packages=PyPDF2
|
||||
termcolor
|
||||
|
Loading…
x
Reference in New Issue
Block a user