Skip to content

Commit 3457e49

Browse files
authored
docs: re-run the gen code (#1129)
* docs: re-run the gen code * update * fix syntax
1 parent 2f2205f commit 3457e49

15 files changed

+298
-256
lines changed

appium/options/common/base.py

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -93,8 +93,11 @@ def as_w3c(capabilities: Dict) -> Dict:
9393
"""
9494
Formats given capabilities to a valid W3C session request object
9595
96-
:param capabilities: Capabilities mapping
97-
:return: W3C session request object
96+
Args:
97+
capabilities: Capabilities mapping
98+
99+
Returns:
100+
W3C session request object
98101
"""
99102

100103
def process_key(k: str) -> str:

appium/webdriver/appium_connection.py

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -39,11 +39,12 @@ class AppiumConnection(RemoteConnection):
3939
"""
4040
A subclass of selenium.webdriver.remote.remote_connection.Remoteconnection.
4141
42-
The changes are:
43-
- The default user agent
44-
- Adds 'X-Idempotency-Key' header in a new session request to avoid proceeding
45-
the same request multiple times in the Appium server side.
46-
- https://github.com/appium/appium-base-driver/pull/400
42+
The changes are
43+
44+
* The default user agent
45+
* Adds 'X-Idempotency-Key' header in a new session request to avoid proceeding
46+
the same request multiple times in the Appium server side.
47+
* https://github.com/appium/appium-base-driver/pull/400
4748
"""
4849

4950
user_agent = f'{PREFIX_HEADER}{library_version()} ({RemoteConnection.user_agent})'

appium/webdriver/appium_service.py

Lines changed: 17 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ def start(self, **kwargs: Any) -> sp.Popen:
5454
5555
The service will be forcefully restarted if it is already running.
5656
57-
Keyword Args:
57+
Args:
5858
env (dict): Environment variables mapping. The default system environment,
5959
which is inherited from the parent process, is assigned by default.
6060
node (str): The full path to the main NodeJS executable. The service will try
@@ -75,9 +75,10 @@ def start(self, **kwargs: Any) -> sp.Popen:
7575
https://appium.io/docs/en/writing-running-appium/server-args/ for more details
7676
about possible arguments and their values.
7777
78-
:return: You can use Popen.communicate interface or stderr/stdout properties
78+
Returns: You can use Popen.communicate interface or stderr/stdout properties
7979
of the instance (stdout/stderr must not be set to None in such case) in order to retrieve the actual process
8080
output.
81+
8182
"""
8283
self.stop()
8384

@@ -134,9 +135,11 @@ def stop(self, timeout: float = 5.5) -> bool:
134135
The call will be ignored if the service is not running
135136
or has been already stopped.
136137
137-
:param timeout: The maximum time in float seconds to wait
138-
for the server process to terminate
139-
:return: `True` if the service was running before being stopped
138+
Args:
139+
timeout: The maximum time in float seconds to wait for the server process to terminate
140+
141+
Returns:
142+
`True` if the service was running before being stopped
140143
"""
141144
was_running = False
142145
if self.is_running:
@@ -170,7 +173,8 @@ def is_listening(self) -> bool:
170173
The default host/port/base path values can be customized by providing
171174
--address/--port/--base-path command line arguments while starting the service.
172175
173-
:return: `True` if the service is running and listening on the given/default host/port
176+
Returns:
177+
`True` if the service is running and listening on the given/default host/port
174178
"""
175179
if not self.is_running:
176180
return False
@@ -194,10 +198,13 @@ def is_service_listening(url: str, timeout: float = 5, custom_validator: Optiona
194198
"""
195199
Check if the service is running
196200
197-
:param url: Full server url
198-
:param timeout: Timeout in float seconds
199-
:param custom_validator: Custom callable method to be executed upon each validation loop before the timeout happens
200-
:return: True if Appium server is running before the timeout
201+
Args:
202+
url: Full server url
203+
timeout: Timeout in float seconds
204+
custom_validator: Custom callable method to be executed upon each validation loop before the timeout happens
205+
206+
Returns:
207+
True if Appium server is running before the timeout
201208
"""
202209
time_started_sec = time.perf_counter()
203210
conn = urllib3.PoolManager(timeout=1.0)

appium/webdriver/extensions/flutter_integration/flutter_commands.py

Lines changed: 72 additions & 67 deletions
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ def wait_for_visible(
4141
timeout (Optional[float]): Maximum wait time in seconds. Defaults to a predefined timeout if not specified.
4242
4343
Returns:
44-
None:
44+
None
4545
"""
4646
opts: Dict[str, Any] = self.__get_locator_options(locator)
4747
if timeout is not None:
@@ -193,72 +193,77 @@ def get_render_tree(
193193
such as type, key, size, attribute, state, visual information, and hierarchy.
194194
195195
The example widget includes the following code, which is rendered as part of the widget tree:
196-
```dart
197-
Semantics(
198-
key: const Key('add_activity_semantics'),
199-
label: 'add_activity_button',
200-
button: true,
201-
child: FloatingActionButton.small(
202-
key: const Key('add_activity_button'),
203-
tooltip: 'add_activity_button',
204-
heroTag: 'add',
205-
backgroundColor: const Color(0xFF2E2E3A),
206-
onPressed: null,
207-
child: Icon(
208-
Icons.add,
209-
size: 16,
210-
color: Colors.amber.shade200.withOpacity(0.5),
211-
semanticLabel: 'Add icon',
212-
),
213-
),
214-
),
215-
```
216-
Example execute command:
217-
>>> flutter_command = FlutterCommand(driver) # noqa
218-
>>> flutter_command.get_render_tree(widget_type='Semantics', key='add_activity_semantics')
219-
output >> [
220-
{
221-
"type": "Semantics",
222-
"elementType": "SingleChildRenderObjectElement",
223-
"description": "Semantics-[<'add_activity_semantics'>]",
224-
"depth": 0,
225-
"key": "[<'add_activity_semantics'>]",
226-
"attributes": {
227-
"semanticsLabel": "add_activity_button"
228-
},
229-
"visual": {},
230-
"state": {},
231-
"rect": {
232-
"x": 0,
233-
"y": 0,
234-
"width": 48,
235-
"height": 48
236-
},
237-
"children": [
238-
{
239-
"type": "FloatingActionButton",
240-
"elementType": "StatelessElement",
241-
"description": "FloatingActionButton-[<'add_activity_button'>]",
242-
"depth": 1,
243-
"key": "[<'add_activity_button'>]",
244-
"attributes": {},
245-
"visual": {},
246-
"state": {},
247-
"rect": {
248-
"x": 0,
249-
"y": 0,
250-
"width": 48,
251-
"height": 48
252-
},
253-
"children": [
254-
{...},
255-
"children": [...]
256-
}
257-
]
258-
}
259-
]
260-
}
261-
]
196+
197+
.. code-block:: dart
198+
199+
Semantics(
200+
key: const Key('add_activity_semantics'),
201+
label: 'add_activity_button',
202+
button: true,
203+
child: FloatingActionButton.small(
204+
key: const Key('add_activity_button'),
205+
tooltip: 'add_activity_button',
206+
heroTag: 'add',
207+
backgroundColor: const Color(0xFF2E2E3A),
208+
onPressed: null,
209+
child: Icon(
210+
Icons.add,
211+
size: 16,
212+
color: Colors.amber.shade200.withOpacity(0.5),
213+
semanticLabel: 'Add icon',
214+
),
215+
),
216+
)
217+
218+
Example execute command:
219+
220+
.. code-block:: python
221+
222+
>>> flutter_command = FlutterCommand(driver) # noqa
223+
>>> flutter_command.get_render_tree(widget_type='Semantics', key='add_activity_semantics')
224+
output >> [
225+
{
226+
"type": "Semantics",
227+
"elementType": "SingleChildRenderObjectElement",
228+
"description": "Semantics-[<'add_activity_semantics'>]",
229+
"depth": 0,
230+
"key": "[<'add_activity_semantics'>]",
231+
"attributes": {
232+
"semanticsLabel": "add_activity_button"
233+
},
234+
"visual": {},
235+
"state": {},
236+
"rect": {
237+
"x": 0,
238+
"y": 0,
239+
"width": 48,
240+
"height": 48
241+
},
242+
"children": [
243+
{
244+
"type": "FloatingActionButton",
245+
"elementType": "StatelessElement",
246+
"description": "FloatingActionButton-[<'add_activity_button'>]",
247+
"depth": 1,
248+
"key": "[<'add_activity_button'>]",
249+
"attributes": {},
250+
"visual": {},
251+
"state": {},
252+
"rect": {
253+
"x": 0,
254+
"y": 0,
255+
"width": 48,
256+
"height": 48
257+
},
258+
"children": [
259+
{...},
260+
"children": [...]
261+
}
262+
]
263+
}
264+
]
265+
}
266+
]
262267
"""
263268
opts = {}
264269
if widget_type is not None:

appium/webdriver/extensions/logs.py

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -26,25 +26,25 @@ def log_types(self) -> List[str]:
2626
compliant browsers.
2727
2828
Example:
29-
--------
30-
>>> driver.log_types
29+
.. code-block:: python
30+
31+
driver.log_types
3132
"""
3233
return self.execute(Command.GET_AVAILABLE_LOG_TYPES)['value']
3334

3435
def get_log(self, log_type: str) -> List[Dict[str, Any]]:
3536
"""Gets the log for a given log type.
3637
37-
Parameters:
38-
----------
39-
log_type : str
40-
- Type of log that which will be returned
38+
Args:
39+
log_type: Type of log that which will be returned
4140
4241
Example:
43-
--------
44-
>>> driver.get_log('browser')
45-
>>> driver.get_log('driver')
46-
>>> driver.get_log('client')
47-
>>> driver.get_log('server')
42+
.. code-block:: python
43+
44+
driver.get_log('browser')
45+
driver.get_log('driver')
46+
driver.get_log('client')
47+
driver.get_log('server')
4848
"""
4949
return self.execute(Command.GET_LOG, {'type': log_type})['value']
5050

0 commit comments

Comments
 (0)