Semaine 4, jour 4, soir
This commit is contained in:
19
Semaine_04/Bibliotheque/logic/actions.py
Normal file
19
Semaine_04/Bibliotheque/logic/actions.py
Normal file
@@ -0,0 +1,19 @@
|
||||
from classes import Book, Library
|
||||
|
||||
library = Library("Romanesque")
|
||||
|
||||
def register_book(title: str, author: str):
|
||||
book = Book(title, author)
|
||||
return library.add_new_book(book)
|
||||
|
||||
def list_titles() -> list[str]:
|
||||
return [book.title for book in library.list_books_in_list()]
|
||||
|
||||
def delete_book(title: str):
|
||||
return library.take_out_book(title)
|
||||
|
||||
def search_by_letter(letter: str):
|
||||
return library.search_book_by_letter(letter)
|
||||
|
||||
def search_by_word(word: str):
|
||||
return library.search_book_by_word(word)
|
||||
Reference in New Issue
Block a user