Skip to content

Commit 6473298

Browse files
committed
Fix for method parameter description in generated docs.
Newlines were breaking parameter description in generated docs, causing them to render incorrectly. This fixes it.
1 parent 989c5ed commit 6473298

18 files changed

Lines changed: 108 additions & 224 deletions

cdp/browser.py

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -302,9 +302,7 @@ def get_histograms(
302302
'''
303303
Get Chrome histograms.
304304
305-
:param query: Requested substring in name. Only histograms which have query as a
306-
substring in their name are extracted. An empty or absent query returns
307-
all histograms.
305+
:param query: Requested substring in name. Only histograms which have query as a substring in their name are extracted. An empty or absent query returns all histograms.
308306
:param delta: If true, retrieve delta since last call.
309307
:returns: Histograms.
310308
'''
@@ -398,8 +396,7 @@ def set_window_bounds(
398396
Set position and/or size of the browser window.
399397
400398
:param window_id: Browser window id.
401-
:param bounds: New window bounds. The 'minimized', 'maximized' and 'fullscreen' states cannot be combined
402-
with 'left', 'top', 'width' or 'height'. Leaves unspecified fields unchanged.
399+
:param bounds: New window bounds. The 'minimized', 'maximized' and 'fullscreen' states cannot be combined with 'left', 'top', 'width' or 'height'. Leaves unspecified fields unchanged.
403400
'''
404401
params: T_JSON_DICT = dict()
405402
params['windowId'] = window_id.to_json()

cdp/debugger.py

Lines changed: 13 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -297,8 +297,7 @@ def enable(
297297
Enables debugger for the given page. Clients should not assume that the debugging has been
298298
enabled until the result for this command is received.
299299
300-
:param max_scripts_cache_size: The maximum size in bytes of collected scripts (not referenced by other heap objects)
301-
the debugger can hold. Puts no limit if paramter is omitted.
300+
:param max_scripts_cache_size: The maximum size in bytes of collected scripts (not referenced by other heap objects) the debugger can hold. Puts no limit if paramter is omitted.
302301
:returns: Unique identifier of the debugger.
303302
'''
304303
params: T_JSON_DICT = dict()
@@ -328,12 +327,9 @@ def evaluate_on_call_frame(
328327
329328
:param call_frame_id: Call frame identifier to evaluate on.
330329
:param expression: Expression to evaluate.
331-
:param object_group: String object group name to put result into (allows rapid releasing resulting object handles
332-
using ``releaseObjectGroup``).
333-
:param include_command_line_api: Specifies whether command line API should be available to the evaluated expression, defaults
334-
to false.
335-
:param silent: In silent mode exceptions thrown during evaluation are not reported and do not pause
336-
execution. Overrides ``setPauseOnException`` state.
330+
:param object_group: String object group name to put result into (allows rapid releasing resulting object handles using ``releaseObjectGroup``).
331+
:param include_command_line_api: Specifies whether command line API should be available to the evaluated expression, defaults to false.
332+
:param silent: In silent mode exceptions thrown during evaluation are not reported and do not pause execution. Overrides ``setPauseOnException`` state.
337333
:param return_by_value: Whether the result is expected to be a JSON object that should be sent by value.
338334
:param generate_preview: Whether preview should be generated for the result.
339335
:param throw_on_side_effect: Whether to throw an exception if side effect cannot be ruled out during evaluation.
@@ -380,8 +376,7 @@ def get_possible_breakpoints(
380376
the same.
381377
382378
:param start: Start of range to search possible breakpoint locations in.
383-
:param end: End of range to search possible breakpoint locations in (excluding). When not specified, end
384-
of scripts is used as end of range.
379+
:param end: End of range to search possible breakpoint locations in (excluding). When not specified, end of scripts is used as end of range.
385380
:param restrict_to_function: Only consider locations which are in the same (non-nested) function as start.
386381
:returns: List of the possible breakpoint locations.
387382
'''
@@ -551,8 +546,7 @@ def set_async_call_stack_depth(
551546
'''
552547
Enables or disables async call stacks tracking.
553548
554-
:param max_depth: Maximum depth of async call stacks. Setting to ``0`` will effectively disable collecting async
555-
call stacks (default).
549+
:param max_depth: Maximum depth of async call stacks. Setting to ``0`` will effectively disable collecting async call stacks (default).
556550
'''
557551
params: T_JSON_DICT = dict()
558552
params['maxDepth'] = max_depth
@@ -613,8 +607,7 @@ def set_breakpoint(
613607
Sets JavaScript breakpoint at a given location.
614608
615609
:param location: Location to set breakpoint in.
616-
:param condition: Expression to use as a breakpoint condition. When specified, debugger will only stop on the
617-
breakpoint if this expression evaluates to true.
610+
:param condition: Expression to use as a breakpoint condition. When specified, debugger will only stop on the breakpoint if this expression evaluates to true.
618611
:returns: a tuple with the following items:
619612
0. breakpointId: Id of the created breakpoint for further reference.
620613
1. actualLocation: Location this breakpoint resolved into.
@@ -669,12 +662,10 @@ def set_breakpoint_by_url(
669662
670663
:param line_number: Line number to set breakpoint at.
671664
:param url: URL of the resources to set breakpoint on.
672-
:param url_regex: Regex pattern for the URLs of the resources to set breakpoints on. Either ``url`` or
673-
``urlRegex`` must be specified.
665+
:param url_regex: Regex pattern for the URLs of the resources to set breakpoints on. Either ``url`` or ``urlRegex`` must be specified.
674666
:param script_hash: Script hash of the resources to set breakpoint on.
675667
:param column_number: Offset in the line to set breakpoint at.
676-
:param condition: Expression to use as a breakpoint condition. When specified, debugger will only stop on the
677-
breakpoint if this expression evaluates to true.
668+
:param condition: Expression to use as a breakpoint condition. When specified, debugger will only stop on the breakpoint if this expression evaluates to true.
678669
:returns: a tuple with the following items:
679670
0. breakpointId: Id of the created breakpoint for further reference.
680671
1. locations: List of the locations this breakpoint resolved into upon addition.
@@ -712,8 +703,7 @@ def set_breakpoint_on_function_call(
712703
calling it will also trigger the breakpoint.
713704
714705
:param object_id: Function object id.
715-
:param condition: Expression to use as a breakpoint condition. When specified, debugger will
716-
stop on the breakpoint if this expression evaluates to true.
706+
:param condition: Expression to use as a breakpoint condition. When specified, debugger will stop on the breakpoint if this expression evaluates to true.
717707
:returns: Id of the created breakpoint for further reference.
718708
'''
719709
params: T_JSON_DICT = dict()
@@ -790,8 +780,7 @@ def set_script_source(
790780
791781
:param script_id: Id of the script to edit.
792782
:param script_source: New content of the script.
793-
:param dry_run: If true the change will not actually be applied. Dry run may be used to get result
794-
description without actually modifying the code.
783+
:param dry_run: If true the change will not actually be applied. Dry run may be used to get result description without actually modifying the code.
795784
:returns: a tuple with the following items:
796785
0. callFrames: (Optional) New stack trace in case editing has happened while VM was stopped.
797786
1. stackChanged: (Optional) Whether current call stack was modified after applying the changes.
@@ -845,8 +834,7 @@ def set_variable_value(
845834
Changes value of variable in a callframe. Object-based scopes are not supported and must be
846835
mutated manually.
847836
848-
:param scope_number: 0-based number of scope as was listed in scope chain. Only 'local', 'closure' and 'catch'
849-
scope types are allowed. Other scopes could be manipulated manually.
837+
:param scope_number: 0-based number of scope as was listed in scope chain. Only 'local', 'closure' and 'catch' scope types are allowed. Other scopes could be manipulated manually.
850838
:param variable_name: Variable name.
851839
:param new_value: New variable value.
852840
:param call_frame_id: Id of callframe that holds variable.
@@ -869,8 +857,7 @@ def step_into(
869857
'''
870858
Steps into the function call.
871859
872-
:param break_on_async_call: Debugger will issue additional Debugger.paused notification if any async task is scheduled
873-
before next pause.
860+
:param break_on_async_call: Debugger will issue additional Debugger.paused notification if any async task is scheduled before next pause.
874861
'''
875862
params: T_JSON_DICT = dict()
876863
if break_on_async_call is not None:

cdp/dom.py

Lines changed: 11 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -498,8 +498,7 @@ def copy_to(
498498
499499
:param node_id: Id of the node to copy.
500500
:param target_node_id: Id of the element to drop the copy into.
501-
:param insert_before_node_id: Drop the copy before this node (if absent, the copy becomes the last child of
502-
``targetNodeId``).
501+
:param insert_before_node_id: Drop the copy before this node (if absent, the copy becomes the last child of ``targetNodeId``).
503502
:returns: Id of the node clone.
504503
'''
505504
params: T_JSON_DICT = dict()
@@ -529,10 +528,8 @@ def describe_node(
529528
:param node_id: Identifier of the node.
530529
:param backend_node_id: Identifier of the backend node.
531530
:param object_id: JavaScript object id of the node wrapper.
532-
:param depth: The maximum depth at which children should be retrieved, defaults to 1. Use -1 for the
533-
entire subtree or provide an integer larger than 0.
534-
:param pierce: Whether or not iframes and shadow roots should be traversed when returning the subtree
535-
(default is false).
531+
:param depth: The maximum depth at which children should be retrieved, defaults to 1. Use -1 for the entire subtree or provide an integer larger than 0.
532+
:param pierce: Whether or not iframes and shadow roots should be traversed when returning the subtree (default is false).
536533
:returns: Node description.
537534
'''
538535
params: T_JSON_DICT = dict()
@@ -701,10 +698,8 @@ def get_document(
701698
'''
702699
Returns the root DOM node (and optionally the subtree) to the caller.
703700
704-
:param depth: The maximum depth at which children should be retrieved, defaults to 1. Use -1 for the
705-
entire subtree or provide an integer larger than 0.
706-
:param pierce: Whether or not iframes and shadow roots should be traversed when returning the subtree
707-
(default is false).
701+
:param depth: The maximum depth at which children should be retrieved, defaults to 1. Use -1 for the entire subtree or provide an integer larger than 0.
702+
:param pierce: Whether or not iframes and shadow roots should be traversed when returning the subtree (default is false).
708703
:returns: Resulting node.
709704
'''
710705
params: T_JSON_DICT = dict()
@@ -727,10 +722,8 @@ def get_flattened_document(
727722
'''
728723
Returns the root DOM node (and optionally the subtree) to the caller.
729724
730-
:param depth: The maximum depth at which children should be retrieved, defaults to 1. Use -1 for the
731-
entire subtree or provide an integer larger than 0.
732-
:param pierce: Whether or not iframes and shadow roots should be traversed when returning the subtree
733-
(default is false).
725+
:param depth: The maximum depth at which children should be retrieved, defaults to 1. Use -1 for the entire subtree or provide an integer larger than 0.
726+
:param pierce: Whether or not iframes and shadow roots should be traversed when returning the subtree (default is false).
734727
:returns: Resulting node.
735728
'''
736729
params: T_JSON_DICT = dict()
@@ -901,8 +894,7 @@ def move_to(
901894
902895
:param node_id: Id of the node to move.
903896
:param target_node_id: Id of the element to drop the moved node into.
904-
:param insert_before_node_id: Drop node before this one (if absent, the moved node becomes the last child of
905-
``targetNodeId``).
897+
:param insert_before_node_id: Drop node before this one (if absent, the moved node becomes the last child of ``targetNodeId``).
906898
:returns: New id of the moved node.
907899
'''
908900
params: T_JSON_DICT = dict()
@@ -1088,10 +1080,8 @@ def request_child_nodes(
10881080
the specified depth.
10891081
10901082
:param node_id: Id of the node to get children for.
1091-
:param depth: The maximum depth at which children should be retrieved, defaults to 1. Use -1 for the
1092-
entire subtree or provide an integer larger than 0.
1093-
:param pierce: Whether or not iframes and shadow roots should be traversed when returning the sub-tree
1094-
(default is false).
1083+
:param depth: The maximum depth at which children should be retrieved, defaults to 1. Use -1 for the entire subtree or provide an integer larger than 0.
1084+
:param pierce: Whether or not iframes and shadow roots should be traversed when returning the sub-tree (default is false).
10951085
'''
10961086
params: T_JSON_DICT = dict()
10971087
params['nodeId'] = node_id.to_json()
@@ -1193,8 +1183,7 @@ def set_attributes_as_text(
11931183
11941184
:param node_id: Id of the element to set attributes for.
11951185
:param text: Text with a number of attributes. Will parse this text using HTML parser.
1196-
:param name: Attribute name to replace with new attributes derived from text in case text parsed
1197-
successfully.
1186+
:param name: Attribute name to replace with new attributes derived from text in case text parsed successfully.
11981187
'''
11991188
params: T_JSON_DICT = dict()
12001189
params['nodeId'] = node_id.to_json()

cdp/dom_debugger.py

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -110,10 +110,8 @@ def get_event_listeners(
110110
Returns event listeners of the given object.
111111
112112
:param object_id: Identifier of the object to return listeners for.
113-
:param depth: The maximum depth at which Node children should be retrieved, defaults to 1. Use -1 for the
114-
entire subtree or provide an integer larger than 0.
115-
:param pierce: Whether or not iframes and shadow roots should be traversed when returning the subtree
116-
(default is false). Reports listeners for all contexts if pierce is enabled.
113+
:param depth: The maximum depth at which Node children should be retrieved, defaults to 1. Use -1 for the entire subtree or provide an integer larger than 0.
114+
:param pierce: Whether or not iframes and shadow roots should be traversed when returning the subtree (default is false). Reports listeners for all contexts if pierce is enabled.
117115
:returns: Array of relevant listeners.
118116
'''
119117
params: T_JSON_DICT = dict()
@@ -233,8 +231,7 @@ def set_event_listener_breakpoint(
233231
Sets breakpoint on particular DOM event.
234232
235233
:param event_name: DOM Event name to stop on (any DOM event will do).
236-
:param target_name: EventTarget interface name to stop on. If equal to ``"*"`` or not provided, will stop on any
237-
EventTarget.
234+
:param target_name: EventTarget interface name to stop on. If equal to ``"*"`` or not provided, will stop on any EventTarget.
238235
'''
239236
params: T_JSON_DICT = dict()
240237
params['eventName'] = event_name

cdp/emulation.py

Lines changed: 7 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -146,8 +146,7 @@ def set_default_background_color_override(
146146
Sets or clears an override of the default background color of the frame. This override is used
147147
if the content does not specify one.
148148
149-
:param color: RGBA of the default background color. If not specified, any existing override will be
150-
cleared.
149+
:param color: RGBA of the default background color. If not specified, any existing override will be cleared.
151150
'''
152151
params: T_JSON_DICT = dict()
153152
if color is not None:
@@ -181,17 +180,15 @@ def set_device_metrics_override(
181180
:param width: Overriding width value in pixels (minimum 0, maximum 10000000). 0 disables the override.
182181
:param height: Overriding height value in pixels (minimum 0, maximum 10000000). 0 disables the override.
183182
:param device_scale_factor: Overriding device scale factor value. 0 disables the override.
184-
:param mobile: Whether to emulate mobile device. This includes viewport meta tag, overlay scrollbars, text
185-
autosizing and more.
183+
:param mobile: Whether to emulate mobile device. This includes viewport meta tag, overlay scrollbars, text autosizing and more.
186184
:param scale: Scale to apply to resulting view image.
187185
:param screen_width: Overriding screen width value in pixels (minimum 0, maximum 10000000).
188186
:param screen_height: Overriding screen height value in pixels (minimum 0, maximum 10000000).
189187
:param position_x: Overriding view X position on screen in pixels (minimum 0, maximum 10000000).
190188
:param position_y: Overriding view Y position on screen in pixels (minimum 0, maximum 10000000).
191189
:param dont_set_visible_size: Do not set visible view size, rely upon explicit setVisibleSize call.
192190
:param screen_orientation: Screen orientation override.
193-
:param viewport: If set, the visible area of the page will be overridden to this viewport. This viewport
194-
change is not observed by the page, e.g. viewport-relative elements do not change positions.
191+
:param viewport: If set, the visible area of the page will be overridden to this viewport. This viewport change is not observed by the page, e.g. viewport-relative elements do not change positions.
195192
'''
196193
params: T_JSON_DICT = dict()
197194
params['width'] = width
@@ -398,12 +395,9 @@ def set_virtual_time_policy(
398395
the current virtual time policy. Note this supersedes any previous time budget.
399396
400397
:param policy:
401-
:param budget: If set, after this many virtual milliseconds have elapsed virtual time will be paused and a
402-
virtualTimeBudgetExpired event is sent.
403-
:param max_virtual_time_task_starvation_count: If set this specifies the maximum number of tasks that can be run before virtual is forced
404-
forwards to prevent deadlock.
405-
:param wait_for_navigation: If set the virtual time policy change should be deferred until any frame starts navigating.
406-
Note any previous deferred policy change is superseded.
398+
:param budget: If set, after this many virtual milliseconds have elapsed virtual time will be paused and a virtualTimeBudgetExpired event is sent.
399+
:param max_virtual_time_task_starvation_count: If set this specifies the maximum number of tasks that can be run before virtual is forced forwards to prevent deadlock.
400+
:param wait_for_navigation: If set the virtual time policy change should be deferred until any frame starts navigating. Note any previous deferred policy change is superseded.
407401
:param initial_virtual_time: If set, base::Time::Now will be overriden to initially return this value.
408402
:returns: Absolute timestamp at which virtual time was first enabled (up time in milliseconds).
409403
'''
@@ -431,8 +425,7 @@ def set_timezone_override(
431425
'''
432426
Overrides default host system timezone with the specified one.
433427
434-
:param timezone_id: The timezone identifier. If empty, disables the override and
435-
restores default host system timezone.
428+
:param timezone_id: The timezone identifier. If empty, disables the override and restores default host system timezone.
436429
'''
437430
params: T_JSON_DICT = dict()
438431
params['timezoneId'] = timezone_id

cdp/fetch.py

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -194,11 +194,8 @@ def enable(
194194
Enables issuing of requestPaused events. A request will be paused until client
195195
calls one of failRequest, fulfillRequest or continueRequest/continueWithAuth.
196196
197-
:param patterns: If specified, only requests matching any of these patterns will produce
198-
fetchRequested event and will be paused until clients response. If not set,
199-
all requests will be affected.
200-
:param handle_auth_requests: If true, authRequired events will be issued and requests will be paused
201-
expecting a call to continueWithAuth.
197+
:param patterns: If specified, only requests matching any of these patterns will produce fetchRequested event and will be paused until clients response. If not set, all requests will be affected.
198+
:param handle_auth_requests: If true, authRequired events will be issued and requests will be paused expecting a call to continueWithAuth.
202199
'''
203200
params: T_JSON_DICT = dict()
204201
if patterns is not None:
@@ -246,8 +243,7 @@ def fulfill_request(
246243
:param response_code: An HTTP response code.
247244
:param response_headers: Response headers.
248245
:param body: A response body.
249-
:param response_phrase: A textual representation of responseCode.
250-
If absent, a standard phrase mathcing responseCode is used.
246+
:param response_phrase: A textual representation of responseCode. If absent, a standard phrase mathcing responseCode is used.
251247
'''
252248
params: T_JSON_DICT = dict()
253249
params['requestId'] = request_id.to_json()

0 commit comments

Comments
 (0)