-
Notifications
You must be signed in to change notification settings - Fork 0
/
main.py
38 lines (30 loc) · 1.71 KB
/
main.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
from Book import *
from Comics import *
from Magazine import *
from Journal import *
from Newspaper import *
from BookstoreManager import BookstoreManager
if __name__ == '__main__':
manager = BookstoreManager(BookstoreItem.storage)
book1 = Book("Tropic of Cancer", "Henry Miller", "Autobiographical novel", 1934, 318)
book2 = Book("1984", "George Orwell", "Novel", 1949, 328)
book3 = Book("Junkie", "William S. Burroughs", "Autobiographical novel", 1953, 166)
# book4 = Book("Edinburgh", "Alexander Chee", "Autobiographical novel", 2001, 209)
book5 = Book("Giovanni's Room", "James Baldwin", "Poem", 1956, 159)
book6 = Book("On the Road", "Jack Kerouac", "Autobiographical novel", 1957, 320)
comics1 = Comics("Deadpool", "Marvel", "Superhero", 2019, 25)
newspaper1 = Newspaper("NYT", "NY", "Weekly", "04.10.2020", 20)
journal1 = Journal("ATT", "AT", "Celebrity", "10.20.2021", 14)
magazine1 = Magazine("Rolling Stone", "Wenner Media LLC", "Musical", "04.10.2020", 18)
magazine2 = Magazine("Esquire", "Hearts Communications Inc", "Fashion", "21.11.2014", 22)
magazine3 = Magazine("Vanity Fair", "Conde Nast", "Musical", "15.12.2020", 30)
magazine4 = Magazine("Elle", "Kevin OMalley", "Musical", "10.04.2018", 14)
print("Unsorted list of autobiographical novel genre items:\n")
for item in manager.find_item_by_genre("Autobiographical novel"):
print(item)
print("Sorted by ascending name list of autobiographical novel genre items:\n")
for item in manager.sort_by_name():
print(item)
print("Sorted by descending num of pages list of autobiographical novel genre items:\n")
for item in manager.sort_by_num_of_pages(descending=True):
print(item)