def addBookItem(self, isbn, rack): b = BookItem(self, isbn, rack, librarian_id=0, librarian_name='', issueDay=0) self.book_item.append(b) self.total_count += 1
def addBookItem(self, isbn, rack): ''' Adds a new copy of the already existing book to the catalog ... Parameters ---------- isbn : string The unique identity number for each copy of the book rack: string Shelf where the book is placed in the physical library Returns ------- True : The book gets added to the library ''' b = BookItem(self, isbn, rack) self.book_item.append(b) self.total_count += 1 return True
def removeFromReservedList(ret_book_item): BookItem.removeFromReservedList(ret_book_item)
def clearIssuerInfo(ret_book_item): BookItem.clearIssuerInfo(ret_book_item)
def extract_document(self, response): book = BookItem() book.setdefault('author', 'none') book.setdefault('title', 'none') book.setdefault('lang', 'none') book.setdefault('loc_class', 'none') book.setdefault('rdate', 'none') book.setdefault('rdate', 'none') for table_cell in response.xpath('//tr'): header = table_cell.xpath('th/text()').extract() if len(header) == 0: book['file_urls'] = [response.urljoin(table_cell.xpath('td[2]/a/@href').extract()[0])] continue if header[0] == 'Author' or header[0] == 'Contributor': book['author'] = table_cell.xpath('td/text()').extract()[0].encode('utf-8') elif header[0] == 'Title': book['title'] = table_cell.xpath('td/text()').extract()[0].encode('utf-8') elif header[0] == 'Language': book['lang'] = table_cell.xpath('td/text()').extract()[0].encode('utf-8') elif header[0] == 'LoC Class': book['loc_class'] = table_cell.xpath('td/text()').extract()[0].encode('utf-8') elif header[0] == 'Release Date': book['rdate'] = table_cell.xpath('td/text()').extract()[0].encode('utf-8') else: continue book['gutenberg_url'] = response.url return book
def remove_from_issue_list(ret_book_item): BookItem.remove_from_issued_list(ret_book_item)
def clear_member_issue_info(ret_book_item): BookItem.clear_issuer_info(ret_book_item)
def updateIssuerInfo(self, book_item, name, student_id, days): BookItem.updateIssuerInfo(book_item, name, student_id, days)
def addToReservedList(book_item): BookItem.addToReservedList(book_item)
def removeFromissuedList(ret_book_item): BookItem.removeFromissuedList(ret_book_item)
def addToissuedList(book_item): BookItem.addToissuedList(book_item)
def updateIssuerInfo(book_item, name, student_id): BookItem.updateIssuerInfo(book_item, name, student_id)
def addBookItem(self, isbn, rack): b = BookItem(self, isbn, rack) self.book_item.append(b) self.total_count += 1 print("Upadated Count: ", self.total_count)
def clearIssuerInfo(ret_book_item): BookItem.clearToReservedList(ret_book_item)
def addBookItem(self, isbn, rack): b = BookItem(self, isbn, rack) self.book_item.append(b) self.total_count += 1
def updateIssuer(book_item, name, student_id, days): BookItem.updateIssuer(book_item, name, student_id, days)
def update_member_issue_info(book_item, name, student_id, days): BookItem.update_issue_info(book_item, name, student_id, days)
def extendDates(book_item, ext_days): BookItem.extendDates(book_item, ext_days)
def add_to_issue_list(book_item): BookItem.add_to_issue_list(book_item)