Skip to content

Commit

Permalink
type hints
Browse files Browse the repository at this point in the history
  • Loading branch information
pomponchik committed Dec 10, 2023
1 parent 66e0209 commit 1b2a082
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions glvrd/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,24 +27,24 @@ class IndexPage(BasePage):


class GlvrdClient:
def __init__(self):
def __init__(self) -> None:
self.driver = self.get_driver()
self.page = self.get_page_object(self.driver)

def __del__(self):
def __del__(self) -> None:
self.driver.quit()

def get_driver(self):
def get_driver(self) -> webdriver.Chrome:
options = webdriver.ChromeOptions()
options.add_argument('--headless')
service=ChromeService(ChromeDriverManager().install())
driver = webdriver.Chrome(service=ChromeService(ChromeDriverManager().install()), options=options)
return driver

def get_page_object(self, driver):
def get_page_object(self, driver) -> IndexPage:
return IndexPage(driver=driver)

def estimate_something(self, text, sleep_before_result=4):
def estimate_something(self, text, sleep_before_result=4) -> EstimationResult:
result = EstimationResult()

self.page.empty_input_field.clear()
Expand All @@ -67,10 +67,10 @@ def estimate_something(self, text, sleep_before_result=4):

return result

def estimate_clarity(self, text, sleep_before_result=4):
def estimate_clarity(self, text, sleep_before_result=4) -> EstimationResult:
self.page.clarity_screen_on.click()
return self.estimate_something(text, sleep_before_result=sleep_before_result)

def estimate_readability(self, text, sleep_before_result=4):
def estimate_readability(self, text, sleep_before_result=4) -> EstimationResult:
self.page.readability_screen_on.click()
return self.estimate_something(text, sleep_before_result=sleep_before_result)

0 comments on commit 1b2a082

Please sign in to comment.