IFPass dev uploaded

This commit is contained in:
Jordan ERNST 2018-04-12 15:11:48 +02:00
parent cab6fb644d
commit 46e18814a4

View File

@ -27,7 +27,7 @@ from termcolor import colored
version = '1.0'
computer = '' # 'test', 'mediatheque' or 'accueil'
computer = 'test' # 'test', 'mediatheque' or 'accueil'
if computer == 'test':
IFPassdir = '\\\\192.168.1.1\SSIC\\04-Projets\IFPass\\'
@ -239,7 +239,11 @@ def printcard(cartefilename):
print('test')
while "the informations are incorrect": # Loop Filling informations
while True:
print('1 - Nouveau membre', '2 - Rechercher un membre', '3 - Quitter', sep='\n')
choix = input('Choix : ')
if choix == '1':
while "the informations are incorrect": # Loop Filling informations
os.system('cls')
init()
f = Figlet(font='big')
@ -281,3 +285,27 @@ while "the informations are incorrect": # Loop Filling informations
bkpdb()
if computer == 'mediatheque' or computer == 'accueil':
printcard(cartefilename)
elif choix == '2':
os.system('cls')
research = input('Entrez le nom, prénom, ou numéro de carte (ou flashez) : ').lower()
try:
with open(clientsfile, 'r', newline='', encoding='utf-8') as csvfile:
results = []
for line in csvfile.readlines():
resfirstname = line.split(';')[1].lower()
ressurname = line.split(';')[2].lower()
resnumber = line.split(';')[3]
if research in (ressurname or resfirstname):
results.append([resfirstname, ressurname, resnumber])
print(results)
except FileNotFoundError:
print('Le fichier client est inexistant.')
elif choix == '3':
sys.exit()
else:
os.system('cls')
print('Choix incorrect !')