From e5fe6d47ae53be191dcb63c9b7e873ca50868130 Mon Sep 17 00:00:00 2001 From: xuzhengyi Date: Tue, 28 Jun 2022 19:24:22 +0800 Subject: [PATCH] Format and fix name --- website_actions/abstract_website_actions.py | 12 ++++++------ website_actions/bookwalker_jp_actions.py | 2 +- website_actions/bookwalker_tw_actions.py | 2 +- website_actions/cmoa_jp_actions.py | 5 +++-- website_actions/coma_jp_novel.py | 2 +- website_actions/takeshobo_co_jp_actions.py | 9 +++++---- 6 files changed, 17 insertions(+), 15 deletions(-) diff --git a/website_actions/abstract_website_actions.py b/website_actions/abstract_website_actions.py index 67a70cd..f0327de 100644 --- a/website_actions/abstract_website_actions.py +++ b/website_actions/abstract_website_actions.py @@ -14,7 +14,7 @@ class WebsiteActions: def __init__(self): self.class_name = self.__class__.__name__ - def get_class_name(self)->str: + def get_class_name(self) -> str: ''' Get class name. ''' @@ -22,7 +22,7 @@ def get_class_name(self)->str: @staticmethod @abstractmethod - def check_url(manga_url)->bool: + def check_url(manga_url) -> bool: ''' Give a manga url and check if the website is this class. ''' @@ -30,21 +30,21 @@ def check_url(manga_url)->bool: @property @abstractmethod - def login_url(self)->str: + def login_url(self) -> str: ''' Login url property. ''' pass @abstractmethod - def get_sum_page_count(self, driver)->int: + def get_sum_page_count(self, driver) -> int: ''' Get sum page count on for the manga. ''' pass @abstractmethod - def move_to_page(self, driver, page)->bool: + def move_to_page(self, driver, page) -> bool: ''' Move to given page. ''' @@ -71,7 +71,7 @@ def get_imgdata(self, driver, now_page): pass @abstractmethod - def get_now_page(self, driver)->int: + def get_now_page(self, driver) -> int: ''' Get now page. ''' diff --git a/website_actions/bookwalker_jp_actions.py b/website_actions/bookwalker_jp_actions.py index b493f23..2f6aad5 100644 --- a/website_actions/bookwalker_jp_actions.py +++ b/website_actions/bookwalker_jp_actions.py @@ -3,8 +3,8 @@ ''' import base64 -from selenium.webdriver.support.ui import WebDriverWait from selenium.webdriver.common.by import By +from selenium.webdriver.support.ui import WebDriverWait try: from abstract_website_actions import WebsiteActions diff --git a/website_actions/bookwalker_tw_actions.py b/website_actions/bookwalker_tw_actions.py index 69a8d82..18512e1 100644 --- a/website_actions/bookwalker_tw_actions.py +++ b/website_actions/bookwalker_tw_actions.py @@ -3,8 +3,8 @@ ''' import base64 -from selenium.webdriver.support.ui import WebDriverWait from selenium.webdriver.common.by import By +from selenium.webdriver.support.ui import WebDriverWait try: from abstract_website_actions import WebsiteActions diff --git a/website_actions/cmoa_jp_actions.py b/website_actions/cmoa_jp_actions.py index ce49627..0ba359a 100644 --- a/website_actions/cmoa_jp_actions.py +++ b/website_actions/cmoa_jp_actions.py @@ -5,8 +5,8 @@ from io import BytesIO import PIL.Image as pil_image -from selenium.webdriver.support.ui import WebDriverWait from selenium.webdriver.common.by import By +from selenium.webdriver.support.ui import WebDriverWait try: from abstract_website_actions import WebsiteActions @@ -53,7 +53,8 @@ def wait_loading(self, driver): lambda x: x.find_element(By.ID, "start_wait")) def get_imgdata(self, driver, now_page): - image_elements = driver.find_element(By.ID, 'content-p%d' % now_page).find_elements(By.CSS_SELECTOR, 'img') + image_elements = driver.find_element( + By.ID, 'content-p%d' % now_page).find_elements(By.CSS_SELECTOR, 'img') imgs_arr = [] imgs_height = [0] diff --git a/website_actions/coma_jp_novel.py b/website_actions/coma_jp_novel.py index dac9212..564c123 100644 --- a/website_actions/coma_jp_novel.py +++ b/website_actions/coma_jp_novel.py @@ -4,8 +4,8 @@ import base64 import time -from selenium.webdriver.support.ui import WebDriverWait from selenium.webdriver.common.by import By +from selenium.webdriver.support.ui import WebDriverWait try: from abstract_website_actions import WebsiteActions diff --git a/website_actions/takeshobo_co_jp_actions.py b/website_actions/takeshobo_co_jp_actions.py index 0b95e2d..9944bfa 100644 --- a/website_actions/takeshobo_co_jp_actions.py +++ b/website_actions/takeshobo_co_jp_actions.py @@ -5,8 +5,8 @@ from io import BytesIO import PIL.Image as pil_image -from selenium.webdriver.support.ui import WebDriverWait from selenium.webdriver.common.by import By +from selenium.webdriver.support.ui import WebDriverWait try: from abstract_website_actions import WebsiteActions @@ -14,9 +14,9 @@ from website_actions.abstract_website_actions import WebsiteActions -class CmoaJP(WebsiteActions): +class TakeshoboJP(WebsiteActions): ''' - cmoa.jp + takeshobo.co.jp ''' login_url = 'https://gammaplus.takeshobo.co.jp/' @@ -53,7 +53,8 @@ def wait_loading(self, driver): lambda x: x.find_element(By.ID, "start_wait")) def get_imgdata(self, driver, now_page): - image_elements = driver.find_element(By.ID, 'content-p%d' % now_page).find_elements(By.CSS_SELECTOR, 'img') + image_elements = driver.find_element( + By.ID, 'content-p%d' % now_page).find_elements(By.CSS_SELECTOR, 'img') imgs_arr = [] imgs_height = [0]