.gitignore updated, little fixes
This commit is contained in:
parent
9b562c2a70
commit
7b23fe7b94
3
.gitignore
vendored
3
.gitignore
vendored
@ -1 +1,4 @@
|
|||||||
.ropeproject
|
.ropeproject
|
||||||
|
Cartes
|
||||||
|
Clients_IFPass.csv
|
||||||
|
Clients_IFPass_backup.csv
|
||||||
|
@ -1 +1,3 @@
|
|||||||
Titre;Prénom;Nom;Numéro de client;Date d'inscripton;Date d'expiration
|
Titre;Prénom;Nom;Numéro de client;Date d'inscripton;Date d'expiration
|
||||||
|
;Fdshg;SDFHG;0000000001;16/04/2018;16/04/2019
|
||||||
|
;Vcxwb;FHD;0000000002;16/04/2018;16/04/2019
|
||||||
|
|
38
IFPass.py
38
IFPass.py
@ -2,14 +2,10 @@
|
|||||||
|
|
||||||
# Written by Jordan ERNST Q1 2018.
|
# Written by Jordan ERNST Q1 2018.
|
||||||
# Contact : pro.ernst@gmail.com
|
# 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 sys
|
import sys
|
||||||
import os
|
import os
|
||||||
import re
|
import re
|
||||||
from contextlib import contextmanager # To hide output
|
|
||||||
from datetime import date, timedelta
|
from datetime import date, timedelta
|
||||||
import csv
|
import csv
|
||||||
import code128
|
import code128
|
||||||
@ -25,11 +21,11 @@ from colorama import init
|
|||||||
from termcolor import colored
|
from termcolor import colored
|
||||||
|
|
||||||
|
|
||||||
version = '1.0'
|
version = 'dev'
|
||||||
|
|
||||||
computer = '' # 'test', 'mediatheque' or 'accueil'
|
computer = '' # 'mediatheque' or 'accueil'
|
||||||
|
|
||||||
if computer == 'test':
|
if version == 'dev':
|
||||||
IFPassdir = '\\\\192.168.1.1\SSIC\\04-Projets\IFPass\\'
|
IFPassdir = '\\\\192.168.1.1\SSIC\\04-Projets\IFPass\\'
|
||||||
elif computer == 'mediatheque':
|
elif computer == 'mediatheque':
|
||||||
IFPassdir = '\\\\192.168.1.1\IFPass\\'
|
IFPassdir = '\\\\192.168.1.1\IFPass\\'
|
||||||
@ -42,31 +38,13 @@ else:
|
|||||||
sys.exit()
|
sys.exit()
|
||||||
|
|
||||||
clientsfile = IFPassdir + 'Clients_IFPass.csv'
|
clientsfile = IFPassdir + 'Clients_IFPass.csv'
|
||||||
clientsbkpfile = IFPassdir + 'Clients_IFPass_bakup.csv'
|
clientsbkpfile = IFPassdir + 'Clients_IFPass_backup.csv'
|
||||||
imgdir = IFPassdir + 'Cartes\\'
|
imgdir = IFPassdir + 'Cartes\\'
|
||||||
pdftemplate = IFPassdir + 'Templates\IFPass_PDF_Template.pdf'
|
pdftemplate = IFPassdir + 'Templates\IFPass_PDF_Template.pdf'
|
||||||
pngtemplate = IFPassdir + 'Templates\IFPass_PNG_Template.png'
|
pngtemplate = IFPassdir + 'Templates\IFPass_PNG_Template.png'
|
||||||
fonttemplate = IFPassdir + 'Templates\Roboto-Bold.ttf'
|
fonttemplate = IFPassdir + 'Templates\Roboto-Bold.ttf'
|
||||||
|
|
||||||
|
|
||||||
@contextmanager
|
|
||||||
def HideOutput(to=os.devnull):
|
|
||||||
fd = sys.stdout.fileno()
|
|
||||||
|
|
||||||
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
|
|
||||||
|
|
||||||
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
|
|
||||||
|
|
||||||
|
|
||||||
def get_fullname():
|
def get_fullname():
|
||||||
firstname = input("Prénom : ").strip()
|
firstname = input("Prénom : ").strip()
|
||||||
firstname = firstname[0].upper() + firstname[1:].lower()
|
firstname = firstname[0].upper() + firstname[1:].lower()
|
||||||
@ -127,12 +105,11 @@ def getpic():
|
|||||||
try:
|
try:
|
||||||
ret, frame = cap.read()
|
ret, frame = cap.read()
|
||||||
cv2.rectangle(frame, (170, 73), (470, 407), (0, 255, 0), 2)
|
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.',
|
cv2.imshow('IFCamera - Touche Espace pour prendre la photo, Echap pour une carte sans photo, Q pour quitter.', frame)
|
||||||
frame)
|
|
||||||
except cv2.error:
|
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")
|
os.system("pause")
|
||||||
sys.exit(0)
|
sys.exit()
|
||||||
SetForegroundWindow(find_window(title='IFCamera - Touche Espace '
|
SetForegroundWindow(find_window(title='IFCamera - Touche Espace '
|
||||||
'pour prendre la photo, Echap pour une carte sans photo, Q pour quitter.'))
|
'pour prendre la photo, Echap pour une carte sans photo, Q pour quitter.'))
|
||||||
k = cv2.waitKey(1)
|
k = cv2.waitKey(1)
|
||||||
@ -281,3 +258,4 @@ while "the informations are incorrect": # Loop Filling informations
|
|||||||
bkpdb()
|
bkpdb()
|
||||||
if computer == 'mediatheque' or computer == 'accueil':
|
if computer == 'mediatheque' or computer == 'accueil':
|
||||||
printcard(cartefilename)
|
printcard(cartefilename)
|
||||||
|
sys.exit()
|
||||||
|
Loading…
Reference in New Issue
Block a user