-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathpooltable-menu.py
More file actions
47 lines (43 loc) · 1.5 KB
/
pooltable-menu.py
File metadata and controls
47 lines (43 loc) · 1.5 KB
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
from pooltable import *
from checkinput import numbercheck
def refreshScreen():
print(chr(27) + "[2J")
viewAllTables()
print "\n"
while True:
print(chr(27) + "[2J")
choice = raw_input('''
Enter 'q' to quit the program at any time.
You may enter 1 to see the status of all tables,
2 to give a table out to a customer,
3 to close a table out when finished,
and 4 to e-mail out the report from today.
What would you like to do? ''')
if choice == 'q':
print(chr(27) + "[2J")
break
elif choice == '1':
refreshScreen()
raw_input("Press Enter to continue...")
elif choice == '2':
refreshScreen()
i = int(numbercheck("Which pool table number would you like to give out? "))
if 0 < i < 13:
pooltable[i-1].giveOut()
refreshScreen()
raw_input("Press Enter to continue...")
elif choice == '3':
refreshScreen()
i = int(numbercheck("Which pool table number would you like to close out? "))
if 0 < i < 13:
pooltable[i-1].closeOut()
print(chr(27) + "[2J")
viewAllTables()
print("")
print("Please let the customer know that they owe ${0:.01} for {1} of game time.".format(pooltable[i-1].cost, pooltable[i-1].readableTime()))
raw_input("Press Enter to continue...")
elif choice == '4':
emailReport()
raw_input("Press Enter to continue...")
else:
print "Sorry, that is not a valid input."