Inital commit. Basic loop running. Logic to switch check in/out, can scan shelf once to store location. Checking books in currently works.

This commit is contained in:
dan
2021-06-10 14:31:37 -04:00
parent 8643c3afa4
commit 8e09abb4d8

16
main.py
View File

@@ -7,6 +7,7 @@ import requests
# print(r.text) # print(r.text)
URL = 'http://library.dandhost.com' URL = 'http://library.dandhost.com'
# URL = 'http://127.0.0.1:8000'
UserID = 1 UserID = 1
Card = 1 Card = 1
@@ -23,15 +24,22 @@ def processBook(ISBN):
while True: while True:
var = str(input()) var = str(input())
x = var.split('.') x = var.split('.')
if x[0] == 'LOC': command = x[0]
if command == 'LOC':
Shelf = x[1] Shelf = x[1]
print('Switching shelf to shelf #' + Shelf) print('Switching shelf to shelf #' + Shelf)
elif x[0] == 'CI': elif command == 'CI':
Mode = 1 Mode = 1
elif x[0] == 'CO': print('Mode Check in')
elif command == 'CO':
Mode = 2 Mode = 2
elif x[0] == 'CARD': print('Mode Check out')
elif command == 'CARD':
Card = 1 Card = 1
elif command == 'UPDATE':
pass
elif command == '':
pass
else: else:
ISBN = x[0] ISBN = x[0]
print(ISBN) print(ISBN)