From 8e09abb4d8ca1b16f41f0cb4d0a9b386389a0588 Mon Sep 17 00:00:00 2001 From: dan Date: Thu, 10 Jun 2021 14:31:37 -0400 Subject: [PATCH] Inital commit. Basic loop running. Logic to switch check in/out, can scan shelf once to store location. Checking books in currently works. --- main.py | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/main.py b/main.py index 74bdd18..721640a 100644 --- a/main.py +++ b/main.py @@ -7,6 +7,7 @@ import requests # print(r.text) URL = 'http://library.dandhost.com' +# URL = 'http://127.0.0.1:8000' UserID = 1 Card = 1 @@ -23,15 +24,22 @@ def processBook(ISBN): while True: var = str(input()) x = var.split('.') - if x[0] == 'LOC': + command = x[0] + if command == 'LOC': Shelf = x[1] print('Switching shelf to shelf #' + Shelf) - elif x[0] == 'CI': + elif command == 'CI': Mode = 1 - elif x[0] == 'CO': + print('Mode Check in') + elif command == 'CO': Mode = 2 - elif x[0] == 'CARD': + print('Mode Check out') + elif command == 'CARD': Card = 1 + elif command == 'UPDATE': + pass + elif command == '': + pass else: ISBN = x[0] print(ISBN)