-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtest
65 lines (57 loc) · 3.11 KB
/
test
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
r = sr.Recognizer()
with sr.Microphone() as source:
print("Say something!")
audio = r.listen(source)
def principal_menu():
v_loop = 'Y'
while v_loop == 'Y':
ch = input('Please enter an option : A - Administration | P - Patient | D - Doctor | X - exit : ')
if ch not in v_valid_entries:
print('<ERROR> Please type A - Administration | P - Patient | D - Doctor | X - exit : <ERROR>')
print()
elif ch == 'A':
print('...Welcome to the Administration Menu')
print()
v_login = input('Please write you email address : ')
if f_email_validation(v_login):
print('<ERROR> You wrote wrong email')
else:
v_data_dict['LOGIN'] = v_login
#v_data_dict['LOGIN'] = f_email_validation(input('Login? '))
v_data_dict['USER_ID'] = f_hasher_pk(v_data_dict['LOGIN'])
v_data_dict['CRYPTOGRAPHIC_PASSWORD'] = f_crypto_password(input('Please write your password : '))
v_data_dict['ACCESS_COUNT'] = 0
v_data_dict['CRYPTOGRAPHIC_PASSWORD'] = p_chyper_password(v_data_dict, v_filename_chyper, v_directory,
v_sheet_name)
v_db_connection = sqlite3.connect(v_directory + v_database_name)
v_data_list = ('', '', '', '')
v_new_user = f_insert_data(v_db_connection, v_data_list, v_data_dict)
print('Record created...')
elif ch == 'P':
print('...Welcome to the Patient Menu')
v_login = input('Please write the login to check : ')
#v_data_dict['LOGIN'] = f_email_validation(input('Please write the login to check : '))
if f_email_validation(v_login):
print('<ERROR> You wrote wrong email')
else:
v_data_dict['LOGIN'] = v_login
v_data_dict['USER_ID'] = ''
v_data_dict['CRYPTOGRAPHIC_PASSWORD'] = ''
v_data_dict['ACCESS_COUNT'] = 0
v_db_connection = sqlite3.connect(v_directory + v_database_name)
v_number_logins = f_search_email(v_db_connection, v_data_dict)
if v_number_logins == -1:
print('<ERROR> The Email you wrote does not exist')
else:
#v_number_logins = f_search_email(v_db_connection, v_data_dict)
print('The LOGIN is : ', v_data_dict['LOGIN'], ' The number of ACCESS COUNT : ', v_number_logins)
v_row_updated = f_update_access_count(v_db_connection, v_data_dict)
p_generate_excel(v_db_connection, v_data_dict, v_filename, v_directory)
elif ch == 'D':
print('...Welcome to the Doctor Menu')
v_login = input('Please write the login to check : ')
elif ch == 'X':
v_loop = 'N'
print()
print('Chao..')
print()