.gitignore updated, little fixes

This commit is contained in:
Jordan ERNST 2018-04-17 14:31:11 +02:00
parent 9b562c2a70
commit 7b23fe7b94
3 changed files with 13 additions and 30 deletions

3
.gitignore vendored
View File

@ -1 +1,4 @@
.ropeproject
Cartes
Clients_IFPass.csv
Clients_IFPass_backup.csv

View File

@ -1 +1,3 @@
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

1 Titre Prénom Nom Numéro de client Date d'inscripton Date d'expiration
2 Fdshg SDFHG 0000000001 16/04/2018 16/04/2019
3 Vcxwb FHD 0000000002 16/04/2018 16/04/2019

View File

@ -2,14 +2,10 @@
# 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 sys
import os
import re
from contextlib import contextmanager # To hide output
from datetime import date, timedelta
import csv
import code128
@ -25,11 +21,11 @@ from colorama import init
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\\'
elif computer == 'mediatheque':
IFPassdir = '\\\\192.168.1.1\IFPass\\'
@ -42,31 +38,13 @@ else:
sys.exit()
clientsfile = IFPassdir + 'Clients_IFPass.csv'
clientsbkpfile = IFPassdir + 'Clients_IFPass_bakup.csv'
clientsbkpfile = IFPassdir + 'Clients_IFPass_backup.csv'
imgdir = IFPassdir + 'Cartes\\'
pdftemplate = IFPassdir + 'Templates\IFPass_PDF_Template.pdf'
pngtemplate = IFPassdir + 'Templates\IFPass_PNG_Template.png'
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():
firstname = input("Prénom : ").strip()
firstname = firstname[0].upper() + firstname[1:].lower()
@ -127,12 +105,11 @@ 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)
@ -281,3 +258,4 @@ while "the informations are incorrect": # Loop Filling informations
bkpdb()
if computer == 'mediatheque' or computer == 'accueil':
printcard(cartefilename)
sys.exit()