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
U
[±dàã@s‚ddlmZddlmZmZddlmZddlZddlZeGdd„dƒƒZ    dddd    d
d d œd d„Z
ddœdd„Z ddœdd„Z dS)é)Ú annotationsé)Ú event_classÚ T_JSON_DICT)Ú    dataclassNc@sJeZdZUdZdZded<dZded<dZded<d    d
„Ze    d d „ƒZ
dS) ÚScreenshotParamsz,
    Encoding options for a screenshot.
    Nztyping.Optional[str]Úformat_ztyping.Optional[int]Úqualityútyping.Optional[bool]Úoptimize_for_speedcCsFtƒ}|jdk    r|j|d<|jdk    r.|j|d<|jdk    rB|j|d<|S)NÚformatr    ÚoptimizeForSpeed)Údictrr    r )ÚselfÚjson©rútd:\z\workplace\vscode\pyvenv\venv\Lib\site-packages\selenium/webdriver/common/devtools/v113/headless_experimental.pyÚto_jsons
 
 
 
 
 
zScreenshotParams.to_jsoncCsJ|d|krt|dƒndd|kr,t|dƒndd|krBt|dƒnddS)Nr r    r )rr    r )ÚstrÚintÚbool)ÚclsrrrrÚ    from_json%s
ýzScreenshotParams.from_json) Ú__name__Ú
__module__Ú __qualname__Ú__doc__rÚ__annotations__r    r rÚ classmethodrrrrrr s
 
rztyping.Optional[float]r
z!typing.Optional[ScreenshotParams]zTtyping.Generator[T_JSON_DICT, T_JSON_DICT, typing.Tuple[bool, typing.Optional[str]]])Úframe_time_ticksÚintervalÚno_display_updatesÚ
screenshotÚreturnccs~tƒ}|dk    r||d<|dk    r&||d<|dk    r6||d<|dk    rJ| ¡|d<d|dœ}|V}t|dƒd    |krxt|d    ƒndfS)
a
    Sends a BeginFrame to the target and returns when the frame was completed. Optionally captures a
    screenshot from the resulting frame. Requires that the target was created with enabled
    BeginFrameControl. Designed for use with --run-all-compositor-stages-before-draw, see also
    https://goo.gle/chrome-headless-rendering for more background.
 
    :param frame_time_ticks: *(Optional)* Timestamp of this BeginFrame in Renderer TimeTicks (milliseconds of uptime). If not set, the current time will be used.
    :param interval: *(Optional)* The interval between BeginFrames that is reported to the compositor, in milliseconds. Defaults to a 60 frames/second interval, i.e. about 16.666 milliseconds.
    :param no_display_updates: *(Optional)* Whether updates should not be committed and drawn onto the display. False by default. If true, only side effects of the BeginFrame will be run, such as layout and animations, but any visual updates may not be visible on the display or in screenshots.
    :param screenshot: *(Optional)* If set, a screenshot of the frame will be captured and returned in the response. Otherwise, no screenshot will be captured. Note that capturing a screenshot can fail, for example, during renderer initialization. In such a case, no screenshot data will be returned.
    :returns: A tuple with the following items:
 
        0. **hasDamage** - Whether the BeginFrame resulted in damage and, thus, a new frame was committed to the display. Reported for diagnostic uses, may be removed in the future.
        1. **screenshotData** - *(Optional)* Base64-encoded image data of the screenshot, if one was requested and successfully taken.
    NZframeTimeTicksr ZnoDisplayUpdatesr"zHeadlessExperimental.beginFrame)ÚmethodÚparamsZ    hasDamageZscreenshotData)rrrr)rr r!r"r%Úcmd_dictrrrrÚ begin_frame.s  þ
þr'z0typing.Generator[T_JSON_DICT, T_JSON_DICT, None])r#ccsddi}|V}dS)z2
    Disables headless events for the target.
    r$zHeadlessExperimental.disableNr©r&rrrrÚdisableWsÿr)ccsddi}|V}dS)z1
    Enables headless events for the target.
    r$zHeadlessExperimental.enableNrr(rrrÚenableasÿr*)NNNN) Ú
__future__rÚutilrrZ dataclassesrÚenumÚtypingrr'r)r*rrrrÚ<module>s  !ü)