refactor: better typing
dataclass replacing dict
This commit is contained in:
@@ -6,15 +6,14 @@ from bs4 import ResultSet
|
||||
import os
|
||||
from urllib.parse import urljoin
|
||||
|
||||
from convert import GBConvert, allbooks_url, get_all_books
|
||||
from convert import GBConvert, allbooks_url, get_all_books, Book
|
||||
|
||||
def main():
|
||||
books = get_all_books()
|
||||
# NOTE consider making this a map()
|
||||
for book in tqdm(books):
|
||||
book_url = book['url']
|
||||
if book_url is not None:
|
||||
GBConvert(book_url).run()
|
||||
if book.url is not None:
|
||||
GBConvert(book.url).run()
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
|
||||
Reference in New Issue
Block a user