Skip to content

Commit

Permalink
style: format code with Autopep8
Browse files Browse the repository at this point in the history
This commit fixes the style issues introduced in 68e4abf according to the output
from Autopep8.

Details: None
  • Loading branch information
deepsource-autofix[bot] authored Feb 24, 2024
1 parent 68e4abf commit 4814b26
Showing 1 changed file with 13 additions and 13 deletions.
26 changes: 13 additions & 13 deletions src/modules/download_images.py
Original file line number Diff line number Diff line change
Expand Up @@ -64,21 +64,21 @@ def book_handler(self, links: Link) -> None:
if create_directory(folder_path, force=True):
for link in links.files:
self.book_download(link=link, folder_path=folder_path)

# Nguyen Xu lys di nha:))
def preview_and_page_download(self, link: LinkFile, folder_path: str) -> None:
if create_directory(folder_path, force=True):
number_of_pages: int = link.num_pages
with alive_bar(number_of_pages) as bar: # pylint: disable=disallowed-name
for page_num in range(1, number_of_pages + 1):
sub_link: str = create_page_link(link.page_link, page_num)
image_bytes: bytes = self.download_image_from_page(
sub_link)
image: ImagePIL = Image.open(BytesIO(image_bytes))
image_path: str = os.path.join(
self.download_directory, f'image_{page_num}.jpg')
image.save(image_path)
bar() # pylint: disable=not-callable
if create_directory(folder_path, force=True):
number_of_pages: int = link.num_pages
with alive_bar(number_of_pages) as bar: # pylint: disable=disallowed-name
for page_num in range(1, number_of_pages + 1):
sub_link: str = create_page_link(link.page_link, page_num)
image_bytes: bytes = self.download_image_from_page(
sub_link)
image: ImagePIL = Image.open(BytesIO(image_bytes))
image_path: str = os.path.join(
self.download_directory, f'image_{page_num}.jpg')
image.save(image_path)
bar() # pylint: disable=not-callable

def preview_and_page_handler(self, link: LinkFile) -> None:
"""Dowload All book's images from page link and previews link
Expand Down

0 comments on commit 4814b26

Please sign in to comment.