zmc
2023-08-08 e792e9a60d958b93aef96050644f369feb25d61b
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
U
[±dÁlã@sddlmZddlmZmZddlmZddlZddlZeGdd„dƒƒZ    Gdd    „d    ej
ƒZ Gd
d „d ej
ƒZ Gd d „d e ƒZeGdd„dƒƒZeGdd„dƒƒZdGdddddddœdd„ZdHdddddddddddddddddœdd„Zddd œd!d"„ZdIdd#d#dddd$œd%d&„ZdJdddddd'ddd(d(dddd(d(ddd)œd*d+„ZdKdd,dddd-œd.d/„ZdLdd#d#d dd(d(dddd0œ
d1d2„Zd3dd4œd5d6„Zd3dd7œd8d9„ZdMddddd:dd;œd<d=„ZdNddd(d(d(d(ddd:ddddd>œ d?d@„ZdOddddd:ddAœdBdC„ZedDƒeGdEdF„dFƒƒƒZdS)Pé)Ú annotationsé)Ú event_classÚ T_JSON_DICT)Ú    dataclassNc@sžeZdZUded<ded<dZded<dZded<dZded<dZded    <dZded
<dZ    d ed <dZ
d ed <dZ d ed<dZ ded<dd„Z edd„ƒZdS)Ú
TouchPointÚfloatÚxÚyNútyping.Optional[float]Úradius_xÚradius_yÚrotation_angleÚforceÚtangential_pressureútyping.Optional[int]Útilt_xÚtilt_yÚtwistÚid_cCsÒtƒ}|j|d<|j|d<|jdk    r.|j|d<|jdk    rB|j|d<|jdk    rV|j|d<|jdk    rj|j|d<|jdk    r~|j|d<|jdk    r’|j|d<|j    dk    r¦|j    |d    <|j
dk    rº|j
|d
<|j dk    rÎ|j |d <|S) Nr    r
ÚradiusXÚradiusYÚ rotationAnglerÚtangentialPressureÚtiltXÚtiltYrÚid) Údictr    r
r r rrrrrrr©ÚselfÚjson©r!úed:\z\workplace\vscode\pyvenv\venv\Lib\site-packages\selenium/webdriver/common/devtools/v113/input_.pyÚto_json1s,
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
zTouchPoint.to_jsoncCsâ|t|dƒt|dƒd|kr*t|dƒndd|kr@t|dƒndd|krVt|dƒndd|krlt|dƒndd|kr‚t|dƒndd|kr˜t|dƒndd    |kr®t|d    ƒndd
|krÄt|d
ƒndd |krÚt|d ƒndd  S) Nr    r
rrrrrrrrr) r    r
r r rrrrrrr)rÚint©Úclsr r!r!r"Ú    from_jsonIs
 
õzTouchPoint.from_json)Ú__name__Ú
__module__Ú __qualname__Ú__annotations__r r rrrrrrrr#Ú classmethodr'r!r!r!r"r s
         rc@s,eZdZdZdZdZdd„Zedd„ƒZdS)    ÚGestureSourceTypeÚdefaultÚtouchZmousecCs|jS©N©Úvalue©rr!r!r"r#_szGestureSourceType.to_jsoncCs||ƒSr0r!r%r!r!r"r'bszGestureSourceType.from_jsonN)    r(r)r*ÚDEFAULTZTOUCHZMOUSEr#r,r'r!r!r!r"r-Zs r-c@s8eZdZdZdZdZdZdZdZdd„Z    e
d    d
„ƒZ d S) Ú MouseButtonÚnoneÚleftZmiddleÚrightÚbackZforwardcCs|jSr0r1r3r!r!r"r#oszMouseButton.to_jsoncCs||ƒSr0r!r%r!r!r"r'rszMouseButton.from_jsonN) r(r)r*ÚNONEÚLEFTZMIDDLEÚRIGHTÚBACKÚFORWARDr#r,r'r!r!r!r"r5gsr5csBeZdZdZddœdd„Zedddœdd„ƒZ‡fd    d
„Z‡ZS) ÚTimeSinceEpochz<
    UTC time in seconds, counted from January 1, 1970.
    r)ÚreturncCs|Sr0r!r3r!r!r"r#{szTimeSinceEpoch.to_json©r r@cCs||ƒSr0r!r%r!r!r"r'~szTimeSinceEpoch.from_jsoncsd tƒ ¡¡S)NzTimeSinceEpoch({}))ÚformatÚsuperÚ__repr__r3©Ú    __class__r!r"rD‚szTimeSinceEpoch.__repr__)    r(r)r*Ú__doc__r#r,r'rDÚ __classcell__r!r!rEr"r?ws
r?c@sJeZdZUded<ded<dZded<dZded<dd    „Zed
d „ƒZdS) Ú DragDataItemÚstrÚ    mime_typeÚdataNútyping.Optional[str]ÚtitleÚbase_urlcCsFtƒ}|j|d<|j|d<|jdk    r.|j|d<|jdk    rB|j|d<|S)NÚmimeTyperLrNÚbaseURL)rrKrLrNrOrr!r!r"r#–s
 
 
 
 
 
zDragDataItem.to_jsoncCsH|t|dƒt|dƒd|kr*t|dƒndd|kr@t|dƒnddS)NrPrLrNrQ)rKrLrNrO©rJr%r!r!r"r' s 
 
üzDragDataItem.from_json)    r(r)r*r+rNrOr#r,r'r!r!r!r"rI†s
 
rIc@s>eZdZUded<ded<dZded<dd    „Zed
d „ƒZdS) ÚDragDataztyping.List[DragDataItem]Úitemsr$Údrag_operations_maskNú!typing.Optional[typing.List[str]]ÚfilescCsFtƒ}dd„|jDƒ|d<|j|d<|jdk    rBdd„|jDƒ|d<|S)NcSsg|] }| ¡‘qSr!©r#©Ú.0Úir!r!r"Ú
<listcomp>¶sz$DragData.to_json.<locals>.<listcomp>rTÚdragOperationsMaskcSsg|]}|‘qSr!r!rYr!r!r"r\¹srW)rrTrUrWrr!r!r"r#´s 
 
zDragData.to_jsoncCs>|dd„|dDƒt|dƒd|kr6dd„|dDƒnddS)NcSsg|]}t |¡‘qSr!)rIr'rYr!r!r"r\¿sz&DragData.from_json.<locals>.<listcomp>rTr]rWcSsg|] }t|ƒ‘qSr!rRrYr!r!r"r\Ás)rTrUrW)r$r%r!r!r"r'¼s
 
ýzDragData.from_json)r(r)r*r+rWr#r,r'r!r!r!r"rSªs
 rSrJrrz0typing.Generator[T_JSON_DICT, T_JSON_DICT, None])Útype_r    r
rLÚ    modifiersr@ccsNtƒ}||d<||d<||d<| ¡|d<|dk    r:||d<d|dœ}|V}dS)    a)
    Dispatches a drag event into the page.
 
    **EXPERIMENTAL**
 
    :param type_: Type of the drag event.
    :param x: X coordinate of the event relative to the main frame's viewport in CSS pixels.
    :param y: Y coordinate of the event relative to the main frame's viewport in CSS pixels. 0 refers to the top of the viewport and Y increases as it proceeds towards the bottom of the viewport.
    :param data:
    :param modifiers: *(Optional)* Bit field representing pressed modifier keys. Alt=1, Ctrl=2, Meta/Command=4, Shift=8 (default: 0).
    Útyper    r
rLNr_zInput.dispatchDragEvent©ÚmethodÚparams©rr#)r^r    r
rLr_rcÚcmd_dictr r!r!r"Údispatch_drag_eventÅs þrfztyping.Optional[TimeSinceEpoch]rMztyping.Optional[bool]rV)r^r_Ú    timestampÚtextÚunmodified_textÚkey_identifierÚcodeÚkeyÚwindows_virtual_key_codeÚnative_virtual_key_codeÚ auto_repeatÚ    is_keypadÚ is_system_keyÚlocationÚcommandsr@ccstƒ}||d<|dk    r||d<|dk    r2| ¡|d<|dk    rB||d<|dk    rR||d<|dk    rb||d<|dk    rr||d<|dk    r‚||d    <|dk    r’||d
<|    dk    r¢|    |d <|
dk    r²|
|d <| dk    rÂ| |d <| dk    rÒ| |d<| dk    râ| |d<|dk    rüdd„|Dƒ|d<d|dœ}|V}dS)a+
    Dispatches a key event to the page.
 
    :param type_: Type of the key event.
    :param modifiers: *(Optional)* Bit field representing pressed modifier keys. Alt=1, Ctrl=2, Meta/Command=4, Shift=8 (default: 0).
    :param timestamp: *(Optional)* Time at which the event occurred.
    :param text: *(Optional)* Text as generated by processing a virtual key code with a keyboard layout. Not needed for for ```keyUp```` and ````rawKeyDown```` events (default: "")
    :param unmodified_text: *(Optional)* Text that would have been generated by the keyboard if no modifiers were pressed (except for shift). Useful for shortcut (accelerator) key handling (default: "").
    :param key_identifier: *(Optional)* Unique key identifier (e.g., 'U+0041') (default: "").
    :param code: *(Optional)* Unique DOM defined string value for each physical key (e.g., 'KeyA') (default: "").
    :param key: *(Optional)* Unique DOM defined string value describing the meaning of the key in the context of active modifiers, keyboard layout, etc (e.g., 'AltGr') (default: "").
    :param windows_virtual_key_code: *(Optional)* Windows virtual key code (default: 0).
    :param native_virtual_key_code: *(Optional)* Native virtual key code (default: 0).
    :param auto_repeat: *(Optional)* Whether the event was generated from auto repeat (default: false).
    :param is_keypad: *(Optional)* Whether the event was generated from the keypad (default: false).
    :param is_system_key: *(Optional)* Whether the event was a system key event (default: false).
    :param location: *(Optional)* Whether the event was from the left or right side of the keyboard. 1=Left, 2=Right (default: 0).
    :param commands: **(EXPERIMENTAL)** *(Optional)* Editing commands to send with the key event (e.g., 'selectAll') (default: []). These are related to but not equal the command names used in ````document.execCommand``` and NSStandardKeyBindingResponding. See https://source.chromium.org/chromium/chromium/src/+/main:third_party/blink/renderer/core/editing/commands/editor_command_names.h for valid command names.
    r`Nr_rgrhZunmodifiedTextZ keyIdentifierrkrlZwindowsVirtualKeyCodeZnativeVirtualKeyCodeZ
autoRepeatZisKeypadZ isSystemKeyrrcSsg|]}|‘qSr!r!rYr!r!r"r\&sz&dispatch_key_event.<locals>.<listcomp>rszInput.dispatchKeyEventrard)r^r_rgrhrirjrkrlrmrnrorprqrrrsrcrer r!r!r"Údispatch_key_eventåsD$ þrt)rhr@ccs"tƒ}||d<d|dœ}|V}dS)zº
    This method emulates inserting text that doesn't come from a key press,
    for example an emoji keyboard or an IME.
 
    **EXPERIMENTAL**
 
    :param text: The text to insert.
    rhzInput.insertTextraN©r)rhrcrer r!r!r"Ú insert_text.s þrvr$)rhÚselection_startÚ selection_endÚreplacement_startÚreplacement_endr@ccsRtƒ}||d<||d<||d<|dk    r.||d<|dk    r>||d<d|dœ}|V}dS)    aÅ
    This method sets the current candidate text for ime.
    Use imeCommitComposition to commit the final text.
    Use imeSetComposition with empty string as text to cancel composition.
 
    **EXPERIMENTAL**
 
    :param text: The text to insert
    :param selection_start: selection start
    :param selection_end: selection end
    :param replacement_start: *(Optional)* replacement start
    :param replacement_end: *(Optional)* replacement end
    rhZselectionStartZ selectionEndNZreplacementStartZreplacementEndzInput.imeSetCompositionraru)rhrwrxryrzrcrer r!r!r"Úime_set_compositionBsþr{ztyping.Optional[MouseButton]r )r^r    r
r_rgÚbuttonÚbuttonsÚ click_countrrrrrÚdelta_xÚdelta_yÚ pointer_typer@ccs
tƒ}||d<||d<||d<|dk    r.||d<|dk    rB| ¡|d<|dk    rV| ¡|d<|dk    rf||d<|dk    rv||d    <|dk    r†||d
<|    dk    r–|    |d <|
dk    r¦|
|d <| dk    r¶| |d <| dk    rÆ| |d<| dk    rÖ| |d<|dk    ræ||d<|dk    rö||d<d|dœ}|V}dS)a
    Dispatches a mouse event to the page.
 
    :param type_: Type of the mouse event.
    :param x: X coordinate of the event relative to the main frame's viewport in CSS pixels.
    :param y: Y coordinate of the event relative to the main frame's viewport in CSS pixels. 0 refers to the top of the viewport and Y increases as it proceeds towards the bottom of the viewport.
    :param modifiers: *(Optional)* Bit field representing pressed modifier keys. Alt=1, Ctrl=2, Meta/Command=4, Shift=8 (default: 0).
    :param timestamp: *(Optional)* Time at which the event occurred.
    :param button: *(Optional)* Mouse button (default: "none").
    :param buttons: *(Optional)* A number indicating which buttons are pressed on the mouse when a mouse event is triggered. Left=1, Right=2, Middle=4, Back=8, Forward=16, None=0.
    :param click_count: *(Optional)* Number of times the mouse button was clicked (default: 0).
    :param force: **(EXPERIMENTAL)** *(Optional)* The normalized pressure, which has a range of [0,1] (default: 0).
    :param tangential_pressure: **(EXPERIMENTAL)** *(Optional)* The normalized tangential pressure, which has a range of [-1,1] (default: 0).
    :param tilt_x: **(EXPERIMENTAL)** *(Optional)* The plane angle between the Y-Z plane and the plane containing both the stylus axis and the Y axis, in degrees of the range [-90,90], a positive tiltX is to the right (default: 0).
    :param tilt_y: **(EXPERIMENTAL)** *(Optional)* The plane angle between the X-Z plane and the plane containing both the stylus axis and the X axis, in degrees of the range [-90,90], a positive tiltY is towards the user (default: 0).
    :param twist: **(EXPERIMENTAL)** *(Optional)* The clockwise rotation of a pen stylus around its own major axis, in degrees in the range [0,359] (default: 0).
    :param delta_x: *(Optional)* X delta in CSS pixels for mouse wheel event (default: 0).
    :param delta_y: *(Optional)* Y delta in CSS pixels for mouse wheel event (default: 0).
    :param pointer_type: *(Optional)* Pointer type (default: "mouse").
    r`r    r
Nr_rgr|r}Ú
clickCountrrrrrÚdeltaXÚdeltaYZ pointerTypezInput.dispatchMouseEventrard)r^r    r
r_rgr|r}r~rrrrrrr€rrcrer r!r!r"Údispatch_mouse_eventesD&  þr…ztyping.List[TouchPoint])r^Ú touch_pointsr_rgr@ccsXtƒ}||d<dd„|Dƒ|d<|dk    r0||d<|dk    rD| ¡|d<d|d    œ}|V}dS)
au
    Dispatches a touch event to the page.
 
    :param type_: Type of the touch event. TouchEnd and TouchCancel must not contain any touch points, while TouchStart and TouchMove must contains at least one.
    :param touch_points: Active touch points on the touch device. One event per any changed point (compared to previous touch event in a sequence) is generated, emulating pressing/moving/releasing points one by one.
    :param modifiers: *(Optional)* Bit field representing pressed modifier keys. Alt=1, Ctrl=2, Meta/Command=4, Shift=8 (default: 0).
    :param timestamp: *(Optional)* Time at which the event occurred.
    r`cSsg|] }| ¡‘qSr!rXrYr!r!r"r\Àsz(dispatch_touch_event.<locals>.<listcomp>Z touchPointsNr_rgzInput.dispatchTouchEventrard)r^r†r_rgrcrer r!r!r"Údispatch_touch_event°s þr‡)
r^r    r
r|rgrr€r_r~r@c     cs’tƒ}    ||    d<||    d<||    d<| ¡|    d<|dk    r>| ¡|    d<|dk    rN||    d<|dk    r^||    d<|dk    rn||    d    <|dk    r~||    d
<d |    d œ}
|
V} dS) a)
    Emulates touch event from the mouse event parameters.
 
    **EXPERIMENTAL**
 
    :param type_: Type of the mouse event.
    :param x: X coordinate of the mouse pointer in DIP.
    :param y: Y coordinate of the mouse pointer in DIP.
    :param button: Mouse button. Only "none", "left", "right" are supported.
    :param timestamp: *(Optional)* Time at which the event occurred (default: current time).
    :param delta_x: *(Optional)* X delta in DIP for mouse wheel event (default: 0).
    :param delta_y: *(Optional)* Y delta in DIP for mouse wheel event (default: 0).
    :param modifiers: *(Optional)* Bit field representing pressed modifier keys. Alt=1, Ctrl=2, Meta/Command=4, Shift=8 (default: 0).
    :param click_count: *(Optional)* Number of times the mouse button was clicked (default: 0).
    r`r    r
r|Nrgrƒr„r_r‚z Input.emulateTouchFromMouseEventrard) r^r    r
r|rgrr€r_r~rcrer r!r!r"Úemulate_touch_from_mouse_eventÌs&  þrˆÚbool)Úignorer@ccs"tƒ}||d<d|dœ}|V}dS)z‚
    Ignores input events (useful while auditing page).
 
    :param ignore: Ignores input events processing when set to true.
    rŠzInput.setIgnoreInputEventsraNru)rŠrcrer r!r!r"Úset_ignore_input_eventsüs þr‹)Úenabledr@ccs"tƒ}||d<d|dœ}|V}dS)zç
    Prevents default drag and drop behavior and instead emits ``Input.dragIntercepted`` events.
    Drag and drop behavior can be directly controlled via ``Input.dispatchDragEvent``.
 
    **EXPERIMENTAL**
 
    :param enabled:
    rŒzInput.setInterceptDragsraNru)rŒrcrer r!r!r"Úset_intercept_drags s þrz"typing.Optional[GestureSourceType])r    r
Ú scale_factorÚrelative_speedÚgesture_source_typer@ccsVtƒ}||d<||d<||d<|dk    r.||d<|dk    rB| ¡|d<d|dœ}|V}dS)    ai
    Synthesizes a pinch gesture over a time period by issuing appropriate touch events.
 
    **EXPERIMENTAL**
 
    :param x: X coordinate of the start of the gesture in CSS pixels.
    :param y: Y coordinate of the start of the gesture in CSS pixels.
    :param scale_factor: Relative scale factor after zooming (>1.0 zooms in, <1.0 zooms out).
    :param relative_speed: *(Optional)* Relative pointer speed in pixels per second (default: 800).
    :param gesture_source_type: *(Optional)* Which type of input events to be generated (default: 'default', which queries the platform for the preferred input type).
    r    r
Z scaleFactorNZ relativeSpeedÚgestureSourceTypezInput.synthesizePinchGesturerard)r    r
rŽrrrcrer r!r!r"Úsynthesize_pinch_gesture!s þr’) r    r
Ú
x_distanceÚ
y_distanceÚ x_overscrollÚ y_overscrollÚ prevent_flingÚspeedrÚ repeat_countÚrepeat_delay_msÚinteraction_marker_namer@c csÎtƒ} || d<|| d<|dk    r&|| d<|dk    r6|| d<|dk    rF|| d<|dk    rV|| d<|dk    rf|| d<|dk    rv|| d    <|dk    rŠ| ¡| d
<|    dk    rš|    | d <|
dk    rª|
| d <| dk    rº| | d <d| dœ} | V}dS)ai
    Synthesizes a scroll gesture over a time period by issuing appropriate touch events.
 
    **EXPERIMENTAL**
 
    :param x: X coordinate of the start of the gesture in CSS pixels.
    :param y: Y coordinate of the start of the gesture in CSS pixels.
    :param x_distance: *(Optional)* The distance to scroll along the X axis (positive to scroll left).
    :param y_distance: *(Optional)* The distance to scroll along the Y axis (positive to scroll up).
    :param x_overscroll: *(Optional)* The number of additional pixels to scroll back along the X axis, in addition to the given distance.
    :param y_overscroll: *(Optional)* The number of additional pixels to scroll back along the Y axis, in addition to the given distance.
    :param prevent_fling: *(Optional)* Prevent fling (default: true).
    :param speed: *(Optional)* Swipe speed in pixels per second (default: 800).
    :param gesture_source_type: *(Optional)* Which type of input events to be generated (default: 'default', which queries the platform for the preferred input type).
    :param repeat_count: *(Optional)* The number of times to repeat the gesture (default: 0).
    :param repeat_delay_ms: *(Optional)* The number of milliseconds delay between each repeat. (default: 250).
    :param interaction_marker_name: *(Optional)* The name of the interaction markers to generate, if not empty (default: "").
    r    r
NZ    xDistanceZ    yDistanceZ xOverscrollZ yOverscrollZ preventFlingr˜r‘Ú repeatCountZ repeatDelayMsZinteractionMarkerNamezInput.synthesizeScrollGesturerard)r    r
r“r”r•r–r—r˜rr™ršr›rcrer r!r!r"Úsynthesize_scroll_gestureBs6  þr)r    r
ÚdurationÚ    tap_countrr@ccs^tƒ}||d<||d<|dk    r&||d<|dk    r6||d<|dk    rJ| ¡|d<d|dœ}|V}dS)    au
    Synthesizes a tap gesture over a time period by issuing appropriate touch events.
 
    **EXPERIMENTAL**
 
    :param x: X coordinate of the start of the gesture in CSS pixels.
    :param y: Y coordinate of the start of the gesture in CSS pixels.
    :param duration: *(Optional)* Duration between touchdown and touchup events in ms (default: 50).
    :param tap_count: *(Optional)* Number of times to perform the tap (e.g. 2 for double tap, default: 1).
    :param gesture_source_type: *(Optional)* Which type of input events to be generated (default: 'default', which queries the platform for the preferred input type).
    r    r
NržZtapCountr‘zInput.synthesizeTapGesturerard)r    r
ržrŸrrcrer r!r!r"Úsynthesize_tap_gesture€s þr zInput.dragInterceptedc@s.eZdZUdZded<edddœdd„ƒZdS)    ÚDragInterceptedz¶
    **EXPERIMENTAL**
 
    Emitted only when ``Input.setInterceptDrags`` is enabled. Use this data with ``Input.dispatchDragEvent`` to
    restore normal drag and drop behavior.
    rSrLrrAcCs|t |d¡dS)NrL)rL)rSr'r%r!r!r"r'­s ÿzDragIntercepted.from_jsonN)r(r)r*rGr+r,r'r!r!r!r"r¡¢s
r¡)N)NNNNNNNNNNNNNN)NN) NNNNNNNNNNNNN)NN)NNNNN)NN)
NNNNNNNNNN)NNN)Ú
__future__rÚutilrrZ dataclassesrÚenumÚtypingrÚEnumr-r5rr?rIrSrfrtrvr{r…r‡rˆr‹rr’rr r¡r!r!r!r"Ú<module>s   L #û"ñ.Iû'ð0Nü!÷"0û$ô(Aû"