-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathLibraryFunctions.py
More file actions
42 lines (33 loc) · 1.02 KB
/
LibraryFunctions.py
File metadata and controls
42 lines (33 loc) · 1.02 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
from LibraryManagmentSystem import LibraryObjects as LO
itemStock = []
users = []
def checkStock():
if not itemStock:
print("Currently no stock\n")
else:
for item in itemStock:
print("ID - {}\nType - {}\nTitle - {} \n".format(item.id, item.type, item.title))
def checkOutItem(id):
if not itemStock:
print("Currently no stock to remove\n")
else:
for item in itemStock:
if item.id == id:
if item.checkedIn:
item.checkedOutItem()
print(item.checkedIn)
else:
print("Item already checked out\n")
def checkInItem(id):
if not itemStock:
print("Currently no stock to remove\n")
else:
for item in itemStock:
if item.id == id:
item.checkedInItem()
print(item.checkedIn)
def registerUser(fName, sName):
id = 1
users.append(LO.Person(id, fName, sName))
id = id + 1
print("Account successfully created")