Skip to content

Commit

Permalink
Format and fix name
Browse files Browse the repository at this point in the history
  • Loading branch information
xuzhengyi1995 committed Jun 28, 2022
1 parent 1302210 commit e5fe6d4
Show file tree
Hide file tree
Showing 6 changed files with 17 additions and 15 deletions.
12 changes: 6 additions & 6 deletions website_actions/abstract_website_actions.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,37 +14,37 @@ 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.
'''
return self.class_name

@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.
'''
return False

@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.
'''
Expand All @@ -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.
'''
Expand Down
2 changes: 1 addition & 1 deletion website_actions/bookwalker_jp_actions.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion website_actions/bookwalker_tw_actions.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
5 changes: 3 additions & 2 deletions website_actions/cmoa_jp_actions.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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]
Expand Down
2 changes: 1 addition & 1 deletion website_actions/coma_jp_novel.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
9 changes: 5 additions & 4 deletions website_actions/takeshobo_co_jp_actions.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,18 +5,18 @@
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
except:
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/'

Expand Down Expand Up @@ -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]
Expand Down

0 comments on commit e5fe6d4

Please sign in to comment.