-
Notifications
You must be signed in to change notification settings - Fork 1
/
main.py
65 lines (55 loc) · 2.15 KB
/
main.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
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
# IMPORTS
#####################
import pyfiglet
from termcolor import colored
from customeroperations.customer import customer_program
from productoperations.products import products_program
from purchase.purchase import purchase_product
from getpass import getpass
# This module is used to hide the password and username for security purposes
# VARIABLES
default_username = "******" #choose your username
default_password = "*********" # choose your password
# MAIN PROGRAM
##########
result = pyfiglet.figlet_format("LUKU SHOP", width=180) # creates artwork with the words]
welcome_message = """
*************************************************************************************************************************************
Welcome to Bruce Shoe store. You'll find a variety of men shoes kindly buy as many as possible cause you can never have enough shoes.
*************************************************************************************************************************************
"""
print(colored(result, "blue"))
print(colored(welcome_message, "blue"))
def disp_menu():
print("""
Kindly select Q to exit or the rest to execute the other operations:
1. Customer Operations
2. Products Operations
3. Purchase Product
Q. To quite the program
""")
def authentication(username, password):
while True:
username = input("Enter username: ")
password = getpass()
print("Kindly login to proceed.")
if username == default_username and password == default_password:
print(colored("\nAuthentication successful!!\n", "green"))
break
else:
print(colored("\nAuthentication failure!!!\n", 'red'))
authentication(default_username, default_password)
while True:
disp_menu()
user_input = input("Please choose an option:\n")
if user_input == "1":
customer_program()
elif user_input == "2":
products_program()
elif user_input == "3":
purchase_product()
elif user_input.upper() == "Q":
print("Exiting Bruce's LUKU POS system...........")
break
else:
print("Please enter a valid value in the range of 0 - 3")