def issueBook(self, name, days=10): book_exist = Catalog.checkIfBookExistsByName(name) if book_exist: BookIssue.issueBook(book_exist[-1], self.student_id, self.name, days) else: print('Book is not available in library')
def removeBook(self, name): #Check if the book by the given name exists book_name_exist = Catalog.checkIfBookExistsByName(name) if book_name_exist: Catalog.books.remove(book_name_exist[-1]) Catalog.diff_count -= 1 else: print('This book is not present in the library')
def returnBook(self, name, BookName): book_exist = Catalog.checkIfBookExistsByName(BookName) if book_exist: book_issued_by_user = Catalog.checkIfBookIssuedByMember( book_exist[0], self.student_id) if book_exist and book_issued_by_user: BookIssue.returnBook(book_exist[0], self.student_id) else: print('This book is not present in library')