Skip to content

Commit b14594b

Browse files
committed
#41 imporved docstring
1 parent 88ceead commit b14594b

File tree

4 files changed

+154
-103
lines changed

4 files changed

+154
-103
lines changed

s_tool/driver.py

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -42,11 +42,23 @@ def close(self):
4242
self.driver.quit()
4343

4444
def __exit__(self, type, value, traceback):
45-
"""release the resources occupied with the current session"""
45+
"""release the resources occupied with the current session
46+
47+
Args:
48+
type ([type]): type
49+
value ([type]): value
50+
traceback ([type]): and traceback
51+
"""
4652
self.close()
4753

4854
def __enter__(self):
49-
"""llows you to implement objects which can be used easily with the with statement"""
55+
"""Returns an selenium webdriver
56+
Allows you to implement objects
57+
which can be used easily with the with statement
58+
59+
Returns:
60+
[webDriver]: selenium webdriver
61+
"""
5062
return self._load_driver()
5163

5264
def _load_driver(self):

s_tool/exceptions.py

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,17 @@ class SToolException(Exception):
44
"""
55

66
def __init__(self, message):
7+
"""[summary]
8+
9+
Args:
10+
message ([str]): Exception message
11+
"""
712
self.message = message
813

914
def __str__(self):
10-
"""Returns an Exception"""
15+
"""Return Exception message
16+
17+
Returns:
18+
[str]: Exception
19+
"""
1120
return str(self.message)

s_tool/parser.py

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2,17 +2,19 @@
22
from s_tool.utils import get_element
33

44

5-
def select_options(element, swap=None, text_exclude=[]):
5+
def select_options(element, swap=None, text_exclude=set()):
66
"""Return dropdown option in key value pair
77
88
Args:
9-
element : An select element
10-
text_exclude : list of values to exclude from result
9+
element ([selenium.element]): An select element
10+
swap ([bool], optional): Value as key if True. Defaults to None.
11+
text_exclude (set, optional): to exclude from result. Defaults to set().
1112
1213
Returns:
13-
return dict of values and text of select element,
14-
return empty dict() if element is not valid or not exists
14+
[dict]: return dict of values and text of select element,
15+
return empty dict() if element is not valid or not exists
1516
"""
17+
1618
option_dict = dict()
1719
if element and hasattr(element, "tag_name") and element.tag_name == "select":
1820
options = get_element(element, "option", "tag_name", many=True)
@@ -36,7 +38,6 @@ def get_table(table):
3638
Returns:
3739
return list of row list,
3840
return [] if table not valid
39-
4041
"""
4142
results = []
4243
if table and hasattr(table, "tag_name") and table.tag_name == "table":

0 commit comments

Comments
 (0)