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 1b2a082 commit 8be39a7
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
@@ -1,6 +1,6 @@
import time
from dataclasses import dataclass, field
from typing import List, Dict, Optional
from typing import List, Dict, Optional, Union

from selenium import webdriver
from selenium.webdriver.common.by import By
Expand Down Expand Up @@ -41,10 +41,10 @@ def get_driver(self) -> webdriver.Chrome:
driver = webdriver.Chrome(service=ChromeService(ChromeDriverManager().install()), options=options)
return driver

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

def estimate_something(self, text, sleep_before_result=4) -> EstimationResult:
def estimate_something(self, text: str, sleep_before_result: Union[int, float]) -> EstimationResult:
result = EstimationResult()

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

return result

def estimate_clarity(self, text, sleep_before_result=4) -> EstimationResult:
def estimate_clarity(self, text: str, sleep_before_result: Union[int, float] = 4) -> EstimationResult:
self.page.clarity_screen_on.click()
return self.estimate_something(text, sleep_before_result=sleep_before_result)
return self.estimate_something(text, sleep_before_result)

def estimate_readability(self, text, sleep_before_result=4) -> EstimationResult:
def estimate_readability(self, text: str, sleep_before_result: Union[int, float] = 4) -> EstimationResult:
self.page.readability_screen_on.click()
return self.estimate_something(text, sleep_before_result=sleep_before_result)
return self.estimate_something(text, sleep_before_result)

0 comments on commit 8be39a7

Please sign in to comment.