Skip to content

Commit 6b30e52

Browse files
committed
Use r-string for doc strings to avoid issue with null bytes (\0) in fetch.continue_response documentation.
1 parent bb0e5ea commit 6b30e52

48 files changed

Lines changed: 516 additions & 516 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

generator/generate.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -108,7 +108,7 @@ def generate_command(module: types.ModuleType, module_name: str,
108108

109109
# Copy docstring.
110110
if fn.__doc__:
111-
doc = " '''" + fn.__doc__ + "'''\n"
111+
doc = " r'''" + fn.__doc__ + "'''\n"
112112
else:
113113
doc = ''
114114

generator/test_generate.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ async def query_selector(
1212
node_id: NodeId,
1313
selector: str
1414
) -> NodeId:
15-
'''
15+
r'''
1616
Executes ``querySelector`` on a given node.
1717
1818
:param node_id: Id of the node to query upon.
@@ -29,7 +29,7 @@ async def query_selector(
2929
def test_accessibility_disable():
3030
expected = dedent("""\
3131
async def disable() -> None:
32-
'''
32+
r'''
3333
Disables the accessibility domain.
3434
'''
3535
session = get_session_context('accessibility.disable')
@@ -48,7 +48,7 @@ async def get_partial_ax_tree(
4848
object_id: typing.Optional[cdp.runtime.RemoteObjectId] = None,
4949
fetch_relatives: typing.Optional[bool] = None
5050
) -> typing.List[AXNode]:
51-
'''
51+
r'''
5252
Fetches the accessibility node and partial accessibility tree for this DOM node, if it exists.
5353
5454
**EXPERIMENTAL**
@@ -64,4 +64,4 @@ async def get_partial_ax_tree(
6464
""")
6565

6666
assert expected == generate_command(cdp.accessibility, 'accessibility',
67-
cdp.accessibility.get_partial_ax_tree)
67+
cdp.accessibility.get_partial_ax_tree)

trio_cdp/generated/accessibility.py

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -26,15 +26,15 @@
2626

2727

2828
async def disable() -> None:
29-
'''
29+
r'''
3030
Disables the accessibility domain.
3131
'''
3232
session = get_session_context('accessibility.disable')
3333
return await session.execute(cdp.accessibility.disable())
3434

3535

3636
async def enable() -> None:
37-
'''
37+
r'''
3838
Enables the accessibility domain which causes ``AXNodeId``'s to remain consistent between method calls.
3939
This turns on accessibility for the page, which can impact performance until accessibility is disabled.
4040
'''
@@ -47,7 +47,7 @@ async def get_ax_node_and_ancestors(
4747
backend_node_id: typing.Optional[cdp.dom.BackendNodeId] = None,
4848
object_id: typing.Optional[cdp.runtime.RemoteObjectId] = None
4949
) -> typing.List[AXNode]:
50-
'''
50+
r'''
5151
Fetches a node and all ancestors up to and including the root.
5252
Requires ``enable()`` to have been called previously.
5353
@@ -66,7 +66,7 @@ async def get_child_ax_nodes(
6666
id_: AXNodeId,
6767
frame_id: typing.Optional[cdp.page.FrameId] = None
6868
) -> typing.List[AXNode]:
69-
'''
69+
r'''
7070
Fetches a particular accessibility node by AXNodeId.
7171
Requires ``enable()`` to have been called previously.
7272
@@ -85,7 +85,7 @@ async def get_full_ax_tree(
8585
max_depth: typing.Optional[int] = None,
8686
frame_id: typing.Optional[cdp.page.FrameId] = None
8787
) -> typing.List[AXNode]:
88-
'''
88+
r'''
8989
Fetches the entire accessibility tree for the root Document
9090
9191
**EXPERIMENTAL**
@@ -105,7 +105,7 @@ async def get_partial_ax_tree(
105105
object_id: typing.Optional[cdp.runtime.RemoteObjectId] = None,
106106
fetch_relatives: typing.Optional[bool] = None
107107
) -> typing.List[AXNode]:
108-
'''
108+
r'''
109109
Fetches the accessibility node and partial accessibility tree for this DOM node, if it exists.
110110
111111
**EXPERIMENTAL**
@@ -123,7 +123,7 @@ async def get_partial_ax_tree(
123123
async def get_root_ax_node(
124124
frame_id: typing.Optional[cdp.page.FrameId] = None
125125
) -> AXNode:
126-
'''
126+
r'''
127127
Fetches the root node.
128128
Requires ``enable()`` to have been called previously.
129129
@@ -143,7 +143,7 @@ async def query_ax_tree(
143143
accessible_name: typing.Optional[str] = None,
144144
role: typing.Optional[str] = None
145145
) -> typing.List[AXNode]:
146-
'''
146+
r'''
147147
Query a DOM node's accessibility subtree for accessible name and role.
148148
This command computes the name and role for all nodes in the subtree, including those that are
149149
ignored for accessibility, and returns those that mactch the specified name and role. If no DOM

trio_cdp/generated/animation.py

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -21,15 +21,15 @@
2121

2222

2323
async def disable() -> None:
24-
'''
24+
r'''
2525
Disables animation domain notifications.
2626
'''
2727
session = get_session_context('animation.disable')
2828
return await session.execute(cdp.animation.disable())
2929

3030

3131
async def enable() -> None:
32-
'''
32+
r'''
3333
Enables animation domain notifications.
3434
'''
3535
session = get_session_context('animation.enable')
@@ -39,7 +39,7 @@ async def enable() -> None:
3939
async def get_current_time(
4040
id_: str
4141
) -> float:
42-
'''
42+
r'''
4343
Returns the current time of the an animation.
4444
4545
:param id_: Id of animation.
@@ -50,7 +50,7 @@ async def get_current_time(
5050

5151

5252
async def get_playback_rate() -> float:
53-
'''
53+
r'''
5454
Gets the playback rate of the document timeline.
5555
5656
:returns: Playback rate for animations on page.
@@ -62,7 +62,7 @@ async def get_playback_rate() -> float:
6262
async def release_animations(
6363
animations: typing.List[str]
6464
) -> None:
65-
'''
65+
r'''
6666
Releases a set of animations to no longer be manipulated.
6767
6868
:param animations: List of animation ids to seek.
@@ -74,7 +74,7 @@ async def release_animations(
7474
async def resolve_animation(
7575
animation_id: str
7676
) -> cdp.runtime.RemoteObject:
77-
'''
77+
r'''
7878
Gets the remote object of the Animation.
7979
8080
:param animation_id: Animation id.
@@ -88,7 +88,7 @@ async def seek_animations(
8888
animations: typing.List[str],
8989
current_time: float
9090
) -> None:
91-
'''
91+
r'''
9292
Seek a set of animations to a particular time within each animation.
9393
9494
:param animations: List of animation ids to seek.
@@ -102,7 +102,7 @@ async def set_paused(
102102
animations: typing.List[str],
103103
paused: bool
104104
) -> None:
105-
'''
105+
r'''
106106
Sets the paused state of a set of animations.
107107
108108
:param animations: Animations to set the pause state of.
@@ -115,7 +115,7 @@ async def set_paused(
115115
async def set_playback_rate(
116116
playback_rate: float
117117
) -> None:
118-
'''
118+
r'''
119119
Sets the playback rate of the document timeline.
120120
121121
:param playback_rate: Playback rate for animations on page
@@ -129,7 +129,7 @@ async def set_timing(
129129
duration: float,
130130
delay: float
131131
) -> None:
132-
'''
132+
r'''
133133
Sets the timing of an animation node.
134134
135135
:param animation_id: Animation id.

trio_cdp/generated/audits.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@
5555
async def check_contrast(
5656
report_aaa: typing.Optional[bool] = None
5757
) -> None:
58-
'''
58+
r'''
5959
Runs the contrast check for the target page. Found issues are reported
6060
using Audits.issueAdded event.
6161
@@ -66,15 +66,15 @@ async def check_contrast(
6666

6767

6868
async def disable() -> None:
69-
'''
69+
r'''
7070
Disables issues domain, prevents further issues from being reported to the client.
7171
'''
7272
session = get_session_context('audits.disable')
7373
return await session.execute(cdp.audits.disable())
7474

7575

7676
async def enable() -> None:
77-
'''
77+
r'''
7878
Enables issues domain, sends the issues collected so far to the client by means of the
7979
``issueAdded`` event.
8080
'''
@@ -88,7 +88,7 @@ async def get_encoded_response(
8888
quality: typing.Optional[float] = None,
8989
size_only: typing.Optional[bool] = None
9090
) -> typing.Tuple[typing.Optional[str], int, int]:
91-
'''
91+
r'''
9292
Returns the response body and size if it were re-encoded with the specified settings. Only
9393
applies to images.
9494

trio_cdp/generated/background_service.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121
async def clear_events(
2222
service: ServiceName
2323
) -> None:
24-
'''
24+
r'''
2525
Clears all stored data for the service.
2626
2727
:param service:
@@ -34,7 +34,7 @@ async def set_recording(
3434
should_record: bool,
3535
service: ServiceName
3636
) -> None:
37-
'''
37+
r'''
3838
Set the recording state for the service.
3939
4040
:param should_record:
@@ -47,7 +47,7 @@ async def set_recording(
4747
async def start_observing(
4848
service: ServiceName
4949
) -> None:
50-
'''
50+
r'''
5151
Enables event updates for the service.
5252
5353
:param service:
@@ -59,7 +59,7 @@ async def start_observing(
5959
async def stop_observing(
6060
service: ServiceName
6161
) -> None:
62-
'''
62+
r'''
6363
Disables event updates for the service.
6464
6565
:param service:

0 commit comments

Comments
 (0)