Skip to content

Commit fe9ac76

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

Some content is hidden

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

48 files changed

+1001
-991
lines changed

cdp/accessibility.py

Lines changed: 18 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717

1818

1919
class AXNodeId(str):
20-
'''
20+
r'''
2121
Unique accessibility node identifier.
2222
'''
2323
def to_json(self) -> str:
@@ -32,7 +32,7 @@ def __repr__(self):
3232

3333

3434
class AXValueType(enum.Enum):
35-
'''
35+
r'''
3636
Enum of possible property types.
3737
'''
3838
BOOLEAN = "boolean"
@@ -62,7 +62,7 @@ def from_json(cls, json: str) -> AXValueType:
6262

6363

6464
class AXValueSourceType(enum.Enum):
65-
'''
65+
r'''
6666
Enum of possible property sources.
6767
'''
6868
ATTRIBUTE = "attribute"
@@ -81,7 +81,7 @@ def from_json(cls, json: str) -> AXValueSourceType:
8181

8282

8383
class AXValueNativeSourceType(enum.Enum):
84-
'''
84+
r'''
8585
Enum of possible native property sources (as a subtype of a particular AXValueSourceType).
8686
'''
8787
DESCRIPTION = "description"
@@ -105,7 +105,7 @@ def from_json(cls, json: str) -> AXValueNativeSourceType:
105105

106106
@dataclass
107107
class AXValueSource:
108-
'''
108+
r'''
109109
A single source for a computed AX property.
110110
'''
111111
#: What type of source this is.
@@ -224,7 +224,7 @@ def from_json(cls, json: T_JSON_DICT) -> AXProperty:
224224

225225
@dataclass
226226
class AXValue:
227-
'''
227+
r'''
228228
A single computed AX property.
229229
'''
230230
#: The type of this value.
@@ -261,7 +261,7 @@ def from_json(cls, json: T_JSON_DICT) -> AXValue:
261261

262262

263263
class AXPropertyName(enum.Enum):
264-
'''
264+
r'''
265265
Values of AXProperty name:
266266
- from 'busy' to 'roledescription': states which apply to every AX node
267267
- from 'live' to 'root': attributes which apply to nodes in live regions
@@ -319,7 +319,7 @@ def from_json(cls, json: str) -> AXPropertyName:
319319

320320
@dataclass
321321
class AXNode:
322-
'''
322+
r'''
323323
A node in the accessibility tree.
324324
'''
325325
#: Unique identifier for this node.
@@ -403,7 +403,7 @@ def from_json(cls, json: T_JSON_DICT) -> AXNode:
403403

404404

405405
def disable() -> typing.Generator[T_JSON_DICT,T_JSON_DICT,None]:
406-
'''
406+
r'''
407407
Disables the accessibility domain.
408408
'''
409409
cmd_dict: T_JSON_DICT = {
@@ -413,7 +413,7 @@ def disable() -> typing.Generator[T_JSON_DICT,T_JSON_DICT,None]:
413413

414414

415415
def enable() -> typing.Generator[T_JSON_DICT,T_JSON_DICT,None]:
416-
'''
416+
r'''
417417
Enables the accessibility domain which causes ``AXNodeId``'s to remain consistent between method calls.
418418
This turns on accessibility for the page, which can impact performance until accessibility is disabled.
419419
'''
@@ -429,7 +429,7 @@ def get_partial_ax_tree(
429429
object_id: typing.Optional[runtime.RemoteObjectId] = None,
430430
fetch_relatives: typing.Optional[bool] = None
431431
) -> typing.Generator[T_JSON_DICT,T_JSON_DICT,typing.List[AXNode]]:
432-
'''
432+
r'''
433433
Fetches the accessibility node and partial accessibility tree for this DOM node, if it exists.
434434
435435
**EXPERIMENTAL**
@@ -462,7 +462,7 @@ def get_full_ax_tree(
462462
max_depth: typing.Optional[int] = None,
463463
frame_id: typing.Optional[page.FrameId] = None
464464
) -> typing.Generator[T_JSON_DICT,T_JSON_DICT,typing.List[AXNode]]:
465-
'''
465+
r'''
466466
Fetches the entire accessibility tree for the root Document
467467
468468
**EXPERIMENTAL**
@@ -490,7 +490,7 @@ def get_full_ax_tree(
490490
def get_root_ax_node(
491491
frame_id: typing.Optional[page.FrameId] = None
492492
) -> typing.Generator[T_JSON_DICT,T_JSON_DICT,AXNode]:
493-
'''
493+
r'''
494494
Fetches the root node.
495495
Requires ``enable()`` to have been called previously.
496496
@@ -515,7 +515,7 @@ def get_ax_node_and_ancestors(
515515
backend_node_id: typing.Optional[dom.BackendNodeId] = None,
516516
object_id: typing.Optional[runtime.RemoteObjectId] = None
517517
) -> typing.Generator[T_JSON_DICT,T_JSON_DICT,typing.List[AXNode]]:
518-
'''
518+
r'''
519519
Fetches a node and all ancestors up to and including the root.
520520
Requires ``enable()`` to have been called previously.
521521
@@ -545,7 +545,7 @@ def get_child_ax_nodes(
545545
id_: AXNodeId,
546546
frame_id: typing.Optional[page.FrameId] = None
547547
) -> typing.Generator[T_JSON_DICT,T_JSON_DICT,typing.List[AXNode]]:
548-
'''
548+
r'''
549549
Fetches a particular accessibility node by AXNodeId.
550550
Requires ``enable()`` to have been called previously.
551551
@@ -574,7 +574,7 @@ def query_ax_tree(
574574
accessible_name: typing.Optional[str] = None,
575575
role: typing.Optional[str] = None
576576
) -> typing.Generator[T_JSON_DICT,T_JSON_DICT,typing.List[AXNode]]:
577-
'''
577+
r'''
578578
Query a DOM node's accessibility subtree for accessible name and role.
579579
This command computes the name and role for all nodes in the subtree, including those that are
580580
ignored for accessibility, and returns those that mactch the specified name and role. If no DOM
@@ -612,7 +612,7 @@ def query_ax_tree(
612612
@event_class('Accessibility.loadComplete')
613613
@dataclass
614614
class LoadComplete:
615-
'''
615+
r'''
616616
**EXPERIMENTAL**
617617
618618
The loadComplete event mirrors the load complete event sent by the browser to assistive
@@ -631,7 +631,7 @@ def from_json(cls, json: T_JSON_DICT) -> LoadComplete:
631631
@event_class('Accessibility.nodesUpdated')
632632
@dataclass
633633
class NodesUpdated:
634-
'''
634+
r'''
635635
**EXPERIMENTAL**
636636
637637
The nodesUpdated event is sent every time a previously requested node has changed the in tree.

cdp/animation.py

Lines changed: 17 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717

1818
@dataclass
1919
class Animation:
20-
'''
20+
r'''
2121
Animation instance.
2222
'''
2323
#: ``Animation``'s id.
@@ -85,7 +85,7 @@ def from_json(cls, json: T_JSON_DICT) -> Animation:
8585

8686
@dataclass
8787
class AnimationEffect:
88-
'''
88+
r'''
8989
AnimationEffect instance
9090
'''
9191
#: ``AnimationEffect``'s delay.
@@ -152,7 +152,7 @@ def from_json(cls, json: T_JSON_DICT) -> AnimationEffect:
152152

153153
@dataclass
154154
class KeyframesRule:
155-
'''
155+
r'''
156156
Keyframes Rule
157157
'''
158158
#: List of animation keyframes.
@@ -178,7 +178,7 @@ def from_json(cls, json: T_JSON_DICT) -> KeyframesRule:
178178

179179
@dataclass
180180
class KeyframeStyle:
181-
'''
181+
r'''
182182
Keyframe Style
183183
'''
184184
#: Keyframe's time offset.
@@ -202,7 +202,7 @@ def from_json(cls, json: T_JSON_DICT) -> KeyframeStyle:
202202

203203

204204
def disable() -> typing.Generator[T_JSON_DICT,T_JSON_DICT,None]:
205-
'''
205+
r'''
206206
Disables animation domain notifications.
207207
'''
208208
cmd_dict: T_JSON_DICT = {
@@ -212,7 +212,7 @@ def disable() -> typing.Generator[T_JSON_DICT,T_JSON_DICT,None]:
212212

213213

214214
def enable() -> typing.Generator[T_JSON_DICT,T_JSON_DICT,None]:
215-
'''
215+
r'''
216216
Enables animation domain notifications.
217217
'''
218218
cmd_dict: T_JSON_DICT = {
@@ -224,7 +224,7 @@ def enable() -> typing.Generator[T_JSON_DICT,T_JSON_DICT,None]:
224224
def get_current_time(
225225
id_: str
226226
) -> typing.Generator[T_JSON_DICT,T_JSON_DICT,float]:
227-
'''
227+
r'''
228228
Returns the current time of the an animation.
229229
230230
:param id_: Id of animation.
@@ -241,7 +241,7 @@ def get_current_time(
241241

242242

243243
def get_playback_rate() -> typing.Generator[T_JSON_DICT,T_JSON_DICT,float]:
244-
'''
244+
r'''
245245
Gets the playback rate of the document timeline.
246246
247247
:returns: Playback rate for animations on page.
@@ -256,7 +256,7 @@ def get_playback_rate() -> typing.Generator[T_JSON_DICT,T_JSON_DICT,float]:
256256
def release_animations(
257257
animations: typing.List[str]
258258
) -> typing.Generator[T_JSON_DICT,T_JSON_DICT,None]:
259-
'''
259+
r'''
260260
Releases a set of animations to no longer be manipulated.
261261
262262
:param animations: List of animation ids to seek.
@@ -273,7 +273,7 @@ def release_animations(
273273
def resolve_animation(
274274
animation_id: str
275275
) -> typing.Generator[T_JSON_DICT,T_JSON_DICT,runtime.RemoteObject]:
276-
'''
276+
r'''
277277
Gets the remote object of the Animation.
278278
279279
:param animation_id: Animation id.
@@ -293,7 +293,7 @@ def seek_animations(
293293
animations: typing.List[str],
294294
current_time: float
295295
) -> typing.Generator[T_JSON_DICT,T_JSON_DICT,None]:
296-
'''
296+
r'''
297297
Seek a set of animations to a particular time within each animation.
298298
299299
:param animations: List of animation ids to seek.
@@ -313,7 +313,7 @@ def set_paused(
313313
animations: typing.List[str],
314314
paused: bool
315315
) -> typing.Generator[T_JSON_DICT,T_JSON_DICT,None]:
316-
'''
316+
r'''
317317
Sets the paused state of a set of animations.
318318
319319
:param animations: Animations to set the pause state of.
@@ -332,7 +332,7 @@ def set_paused(
332332
def set_playback_rate(
333333
playback_rate: float
334334
) -> typing.Generator[T_JSON_DICT,T_JSON_DICT,None]:
335-
'''
335+
r'''
336336
Sets the playback rate of the document timeline.
337337
338338
:param playback_rate: Playback rate for animations on page
@@ -351,7 +351,7 @@ def set_timing(
351351
duration: float,
352352
delay: float
353353
) -> typing.Generator[T_JSON_DICT,T_JSON_DICT,None]:
354-
'''
354+
r'''
355355
Sets the timing of an animation node.
356356
357357
:param animation_id: Animation id.
@@ -372,7 +372,7 @@ def set_timing(
372372
@event_class('Animation.animationCanceled')
373373
@dataclass
374374
class AnimationCanceled:
375-
'''
375+
r'''
376376
Event for when an animation has been cancelled.
377377
'''
378378
#: Id of the animation that was cancelled.
@@ -388,7 +388,7 @@ def from_json(cls, json: T_JSON_DICT) -> AnimationCanceled:
388388
@event_class('Animation.animationCreated')
389389
@dataclass
390390
class AnimationCreated:
391-
'''
391+
r'''
392392
Event for each animation that has been created.
393393
'''
394394
#: Id of the animation that was created.
@@ -404,7 +404,7 @@ def from_json(cls, json: T_JSON_DICT) -> AnimationCreated:
404404
@event_class('Animation.animationStarted')
405405
@dataclass
406406
class AnimationStarted:
407-
'''
407+
r'''
408408
Event for animation that has been started.
409409
'''
410410
#: Animation that was started.

0 commit comments

Comments
 (0)