-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathmain_program.py
50 lines (39 loc) · 1.66 KB
/
main_program.py
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
from write_ import*
from read_ import*
from display_ import*
from check_ import*
from borrow_ import*
from return_ import*
mainLoop = 'y'
while mainLoop == 'y':
start_screen()
print('\t\t\n ENTER [EXIT] TO QUIT \t ENTER [RETURN] TO RETURN BOOK \n')
userSelection = get_user_selection()
isBookAvailable,contents,i = user_input(userSelection)
if (isBookAvailable == True):
print(userSelection,'BOOK AVAILABLE TO BORROW')
#print('book index is',i,j)
userName = get_user_name()
isUserAvailable = user_auth(userName)
if (isUserAvailable == True):
print("Proceed to Book Borrow Porcess\n")
new_borrow_contents,statusB = borrow_procress_(userSelection,contents,i)
if statusB == True:
content_to_write(new_borrow_contents)
borrow_message_for_user(userName,userSelection)
print('SucessFully Borrowed')
elif (isBookAvailable == 'RETURN'):
print('BOOK RETURNING PROCESS')
userSelection = get_user_selection()
userName = get_user_name()
isUserAvailable = user_auth(userName)
if (isUserAvailable == True):
print("PROCEED BOOK RETURNING PROCESS\n")
new_return_contents,statusR = return_procress_(userSelection,contents,i)
if statusR == True:
content_to_write(new_return_contents)
return_message_for_user(userName,userSelection)
print('SucessFully Returned')
elif (isBookAvailable == False):
print("\n\t\tSORRY, WE COULD NOT PROVIDE SERVICE YOU ASKED FOR\n")
mainLoop == 'y'