Skip to content

Commit 9b92963

Browse files
committed
refactor: standardize argument documentation format in IE options and webdriver classes
1 parent 8db0490 commit 9b92963

File tree

3 files changed

+31
-23
lines changed

3 files changed

+31
-23
lines changed

py/selenium/webdriver/ie/options.py

Lines changed: 17 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -27,9 +27,9 @@ class ElementScrollBehavior(Enum):
2727

2828

2929
class _IeOptionsDescriptor:
30-
"""_IeOptionsDescriptor is an implementation of Descriptor Protocol:
30+
"""_IeOptionsDescriptor is an implementation of Descriptor Protocol.
3131
32-
: Any look-up or assignment to the below attributes in `Options` class will be intercepted
32+
Any look-up or assignment to the below attributes in `Options` class will be intercepted
3333
by `__get__` and `__set__` method respectively.
3434
3535
- `browser_attach_timeout`
@@ -50,13 +50,15 @@ class _IeOptionsDescriptor:
5050
- `attach_to_edge_chrome`
5151
- `edge_executable_path`
5252
53+
When an attribute lookup happens:
5354
54-
: When an attribute lookup happens,
5555
Example:
5656
`self. browser_attach_timeout`
5757
`__get__` method does a dictionary look up in the dictionary `_options` in `Options` class
5858
and returns the value of key `browserAttachTimeout`
59-
: When an attribute assignment happens,
59+
60+
When an attribute assignment happens:
61+
6062
Example:
6163
`self.browser_attach_timeout` = 30
6264
`__set__` method sets/updates the value of the key `browserAttachTimeout` in `_options`
@@ -368,20 +370,26 @@ def __init__(self) -> None:
368370

369371
@property
370372
def options(self) -> dict:
371-
""":Returns: A dictionary of browser options."""
373+
"""
374+
Returns:
375+
A dictionary of browser options.
376+
"""
372377
return self._options
373378

374379
@property
375380
def additional_options(self) -> dict:
376-
""":Returns: The additional options."""
381+
"""
382+
Returns:
383+
The additional options.
384+
"""
377385
return self._additional
378386

379387
def add_additional_option(self, name: str, value) -> None:
380388
"""Adds an additional option not yet added as a safe option for IE.
381389
382-
:Args:
383-
- name: name of the option to add
384-
- value: value of the option to add
390+
Args:
391+
name: name of the option to add
392+
value: value of the option to add
385393
"""
386394
self._additional[name] = value
387395

py/selenium/webdriver/ie/service.py

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -38,16 +38,16 @@ def __init__(
3838
) -> None:
3939
"""Creates a new instance of the Service.
4040
41-
:Args:
42-
- executable_path : Path to the IEDriver
43-
- port : Port the service is running on
44-
- host : (Optional) IP address the service port is bound
45-
- service_args: (Optional) Sequence of args to be passed to the subprocess when launching the executable.
46-
- log_level : (Optional) Level of logging of service, may be "FATAL", "ERROR", "WARN", "INFO", "DEBUG",
47-
"TRACE". Default is "FATAL".
48-
- log_output: (Optional) int representation of STDOUT/DEVNULL, any IO instance or String path to file.
49-
Default is "stdout".
50-
- driver_path_env_key: (Optional) Environment variable to use to get the path to the driver executable.
41+
Args:
42+
executable_path: Path to the IEDriver
43+
port: Port the service is running on
44+
host: (Optional) IP address the service port is bound
45+
service_args: (Optional) Sequence of args to be passed to the subprocess when launching the executable.
46+
log_level: (Optional) Level of logging of service, may be "FATAL", "ERROR", "WARN", "INFO", "DEBUG",
47+
"TRACE". Default is "FATAL".
48+
log_output: (Optional) int representation of STDOUT/DEVNULL, any IO instance or String path to file.
49+
Default is "stdout".
50+
driver_path_env_key: (Optional) Environment variable to use to get the path to the driver executable.
5151
"""
5252
self._service_args = list(service_args or [])
5353
driver_path_env_key = driver_path_env_key or "SE_IEDRIVER"

py/selenium/webdriver/ie/webdriver.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -39,10 +39,10 @@ def __init__(
3939
4040
Starts the service and then creates new instance of Ie driver.
4141
42-
:Args:
43-
- options - IE Options instance, providing additional IE options
44-
- service - (Optional) service instance for managing the starting and stopping of the driver.
45-
- keep_alive - Whether to configure RemoteConnection to use HTTP keep-alive.
42+
Args:
43+
options: IE Options instance, providing additional IE options
44+
service: (Optional) service instance for managing the starting and stopping of the driver.
45+
keep_alive: Whether to configure RemoteConnection to use HTTP keep-alive.
4646
"""
4747

4848
self.service = service if service else Service()

0 commit comments

Comments
 (0)