
     f,                       d dl mZ ddlmZmZ d dlmZ d dlZd dlZe G d d                      Z	e G d d	                      Z
e G d
 d                      Ze G d d                      Z G d dej                  Z G d dej                  Ze G d d                      Ze G d d                      Ze G d d                      Zd!dZd"dZd#d ZdS )$    )annotations   )event_classT_JSON_DICT)	dataclassNc                      e Zd ZU dZded<   ded<   ded<   ded<   ded<   ded	<   d
Zded<   d
Zded<   d Zed             Z	d
S )	GPUDevicez6
    Describes a single graphics processor (GPU).
    float	vendor_id	device_idstrvendor_stringdevice_stringdriver_vendordriver_versionNztyping.Optional[float]
sub_sys_idrevisionc                    t                      }| j        |d<   | j        |d<   | j        |d<   | j        |d<   | j        |d<   | j        |d<   | j        
| j        |d<   | j        
| j        |d<   |S )	NvendorIddeviceIdvendorStringdeviceStringdriverVendordriverVersionsubSysIdr   )	dictr   r   r   r   r   r   r   r   selfjsons     v/var/www/api.educacionweb.es/myenv/lib/python3.11/site-packages/selenium/webdriver/common/devtools/v126/system_info.pyto_jsonzGPUDevice.to_json*   s    vv>Z>Z#1^#1^#1^ $ 3_?&#D=$#}D    c                p    | t          |d                   t          |d                   t          |d                   t          |d                   t          |d                   t          |d                   d|v rt          |d                   nd d|v rt          |d                   nd 	          S )
Nr   r   r   r   r   r   r   r   )r   r   r   r   r   r   r   r   )r
   r   clsr   s     r    	from_jsonzGPUDevice.from_json8   s    sD,--D,--d>233d>233d>233tO4552<2D2DuT*-...$0:d0B0BU4
+,,,	
 	
 	
 		
r"   )
__name__
__module____qualname____doc____annotations__r   r   r!   classmethodr&    r"   r    r	   r	      s                 *.J---- (,H++++   

 

 [

 

 

r"   r	   c                  D    e Zd ZU dZded<   ded<   d Zed             ZdS )SizezA
    Describes the width and height dimensions of an entity.
    intwidthheightc                J    t                      }| j        |d<   | j        |d<   |S )Nr1   r2   )r   r1   r2   r   s     r    r!   zSize.to_jsonQ   s&    vv
WXr"   c                h     | t          |d                   t          |d                             S )Nr1   r2   )r1   r2   )r0   r$   s     r    r&   zSize.from_jsonW   s9    sd7m$$tH~&&
 
 
 	
r"   Nr'   r(   r)   r*   r+   r!   r,   r&   r-   r"   r    r/   r/   F   s`           JJJ KKK   
 
 [
 
 
r"   r/   c                  N    e Zd ZU dZded<   ded<   ded<   d Zed             Zd	S )
 VideoDecodeAcceleratorCapabilityzo
    Describes a supported video decoding profile with its associated minimum and
    maximum resolutions.
    r   profiler/   max_resolutionmin_resolutionc                    t                      }| j        |d<   | j                                        |d<   | j                                        |d<   |S )Nr8   maxResolutionminResolution)r   r8   r9   r!   r:   r   s     r    r!   z(VideoDecodeAcceleratorCapability.to_jsonn   sM    vv,Y $ 3 ; ; = =_ $ 3 ; ; = =_r"   c                     | t          |d                   t                              |d                   t                              |d                             S )Nr8   r<   r=   )r8   r9   r:   )r   r/   r&   r$   s     r    r&   z*VideoDecodeAcceleratorCapability.from_jsonu   sR    sY((>>$*?@@>>$*?@@
 
 
 	
r"   Nr5   r-   r"   r    r7   r7   _   sq          
 LLL     
 
 [
 
 
r"   r7   c                  X    e Zd ZU dZded<   ded<   ded<   ded<   d	 Zed
             ZdS ) VideoEncodeAcceleratorCapabilityzx
    Describes a supported video encoding profile with its associated maximum
    resolution and maximum framerate.
    r   r8   r/   r9   r0   max_framerate_numeratormax_framerate_denominatorc                    t                      }| j        |d<   | j                                        |d<   | j        |d<   | j        |d<   |S )Nr8   r<   maxFramerateNumeratormaxFramerateDenominator)r   r8   r9   r!   rA   rB   r   s     r    r!   z(VideoEncodeAcceleratorCapability.to_json   sP    vv,Y $ 3 ; ; = =_(,(D$%*.*H&'r"   c           	          | t          |d                   t                              |d                   t          |d                   t          |d                             S )Nr8   r<   rD   rE   )r8   r9   rA   rB   )r   r/   r&   r0   r$   s     r    r&   z*VideoEncodeAcceleratorCapability.from_json   s`    sY((>>$*?@@$'-D(E$F$F&)$/H*I&J&J	
 
 
 	
r"   Nr5   r-   r"   r    r@   r@   ~   s}          
 LLL 
 !   """"   
 
 [
 
 
r"   r@   c                  :    e Zd ZdZdZdZdZd Zed             Z	dS )SubsamplingFormatz>
    YUV subsampling type of the pixels of a given image.
    yuv420yuv422yuv444c                    | j         S Nvaluer   s    r    r!   zSubsamplingFormat.to_json   
    zr"   c                     | |          S rM   r-   r$   s     r    r&   zSubsamplingFormat.from_json       s4yyr"   N)
r'   r(   r)   r*   YUV420YUV422YUV444r!   r,   r&   r-   r"   r    rH   rH      sY          FFF     [  r"   rH   c                  :    e Zd ZdZdZdZdZd Zed             Z	dS )	ImageTypez(
    Image format of a given image.
    jpegwebpunknownc                    | j         S rM   rN   rP   s    r    r!   zImageType.to_json   rQ   r"   c                     | |          S rM   r-   r$   s     r    r&   zImageType.from_json   rS   r"   N)
r'   r(   r)   r*   JPEGWEBPUNKNOWNr!   r,   r&   r-   r"   r    rX   rX      sY          DDG     [  r"   rX   c                  X    e Zd ZU dZded<   ded<   ded<   ded<   d	 Zed
             ZdS ) ImageDecodeAcceleratorCapabilityz
    Describes a supported image decoding profile with its associated minimum and
    maximum resolutions and subsampling.
    rX   
image_typer/   max_dimensionsmin_dimensionsztyping.List[SubsamplingFormat]subsamplingsc                    t                      }| j                                        |d<   | j                                        |d<   | j                                        |d<   d | j        D             |d<   |S )N	imageTypemaxDimensionsminDimensionsc                6    g | ]}|                                 S r-   r!   .0is     r    
<listcomp>z<ImageDecodeAcceleratorCapability.to_json.<locals>.<listcomp>   s     GGG		GGGr"   rf   )r   rc   r!   rd   re   rf   r   s     r    r!   z(ImageDecodeAcceleratorCapability.to_json   su    vv O3355[ $ 3 ; ; = =_ $ 3 ; ; = =_GGT5FGGG^r"   c                     | t                               |d                   t                              |d                   t                              |d                   d |d         D                       S )Nrh   ri   rj   c                B    g | ]}t                               |          S r-   )rH   r&   rm   s     r    rp   z>ImageDecodeAcceleratorCapability.from_json.<locals>.<listcomp>   s'    WWWQ+55a88WWWr"   rf   )rc   rd   re   rf   )rX   r&   r/   r$   s     r    r&   z*ImageDecodeAcceleratorCapability.from_json   so    s **4+<==>>$*?@@>>$*?@@WW$~BVWWW	
 
 
 	
r"   Nr5   r-   r"   r    rb   rb      s          
    1000   
 
 [
 
 
r"   rb   c                  ~    e Zd ZU dZded<   ded<   ded<   ded	<   d
ed<   dZded<   dZded<   d Zed             Z	dS )GPUInfoz>
    Provides information about the GPU(s) on the system.
    ztyping.List[GPUDevice]devicesztyping.List[str]driver_bug_workaroundsz-typing.List[VideoDecodeAcceleratorCapability]video_decodingz-typing.List[VideoEncodeAcceleratorCapability]video_encodingz-typing.List[ImageDecodeAcceleratorCapability]image_decodingNztyping.Optional[dict]aux_attributesfeature_statusc                .   t                      }d | j        D             |d<   d | j        D             |d<   d | j        D             |d<   d | j        D             |d<   d	 | j        D             |d
<   | j        
| j        |d<   | j        
| j        |d<   |S )Nc                6    g | ]}|                                 S r-   rl   rm   s     r    rp   z#GPUInfo.to_json.<locals>.<listcomp>  s     ===1199;;===r"   ru   c                    g | ]}|S r-   r-   rm   s     r    rp   z#GPUInfo.to_json.<locals>.<listcomp>  s    'O'O'Oa'O'O'Or"   driverBugWorkaroundsc                6    g | ]}|                                 S r-   rl   rm   s     r    rp   z#GPUInfo.to_json.<locals>.<listcomp>        J J J J J Jr"   videoDecodingc                6    g | ]}|                                 S r-   rl   rm   s     r    rp   z#GPUInfo.to_json.<locals>.<listcomp>  r   r"   videoEncodingc                6    g | ]}|                                 S r-   rl   rm   s     r    rp   z#GPUInfo.to_json.<locals>.<listcomp>  r   r"   imageDecodingauxAttributesfeatureStatus)r   ru   rv   rw   rx   ry   rz   r{   r   s     r    r!   zGPUInfo.to_json  s    vv=====Y'O'O43N'O'O'O#$ J Jd6I J J J_ J Jd6I J J J_ J Jd6I J J J_*$($7D!*$($7D!r"   c                *    | d |d         D             d |d         D             d |d         D             d |d         D             d	 |d
         D             d|v rt          |d                   nd d|v rt          |d                   nd           S )Nc                B    g | ]}t                               |          S r-   )r	   r&   rm   s     r    rp   z%GPUInfo.from_json.<locals>.<listcomp>  s&    EEEY((++EEEr"   ru   c                ,    g | ]}t          |          S r-   )r   rm   s     r    rp   z%GPUInfo.from_json.<locals>.<listcomp>  s    #Q#Q#QqCFF#Q#Q#Qr"   r   c                B    g | ]}t                               |          S r-   )r7   r&   rm   s     r    rp   z%GPUInfo.from_json.<locals>.<listcomp>  '    iiia<FFqIIiiir"   r   c                B    g | ]}t                               |          S r-   )r@   r&   rm   s     r    rp   z%GPUInfo.from_json.<locals>.<listcomp>  r   r"   r   c                B    g | ]}t                               |          S r-   )rb   r&   rm   s     r    rp   z%GPUInfo.from_json.<locals>.<listcomp>  r   r"   r   r   r   )ru   rv   rw   rx   ry   rz   r{   )r   r$   s     r    r&   zGPUInfo.from_json  s    sEET)_EEE#Q#QD9O4P#Q#Q#QiiSWXgShiiiiiSWXgShiiiiiSWXgShiii:IT:Q:Q4_ 5666W[:IT:Q:Q4_ 5666W[
 
 
 	
r"   )
r'   r(   r)   r*   r+   rz   r{   r!   r,   r&   r-   r"   r    rt   rt      s           $### -,,, BAAA BAAA BAAA -1N0000 -1N0000   	
 	
 [	
 	
 	
r"   rt   c                  N    e Zd ZU dZded<   ded<   ded<   d Zed	             Zd
S )ProcessInfoz"
    Represents process info.
    r   type_r0   id_r
   cpu_timec                ^    t                      }| j        |d<   | j        |d<   | j        |d<   |S )NtypeidcpuTime)r   r   r   r   r   s     r    r!   zProcessInfo.to_json*  s1    vvzVXT
-Yr"   c                     | t          |d                   t          |d                   t          |d                             S )Nr   r   r   )r   r   r   )r   r0   r
   r$   s     r    r&   zProcessInfo.from_json1  sF    sd6l##DJ4	?++
 
 
 	
r"   Nr5   r-   r"   r    r   r     sk           JJJ HHH OOO   
 
 [
 
 
r"   r   returnPtyping.Generator[T_JSON_DICT, T_JSON_DICT, typing.Tuple[GPUInfo, str, str, str]]c               #     K   ddi} | V }t                               |d                   t          |d                   t          |d                   t          |d                   fS )a  
    Returns information about the system.

    :returns: A tuple with the following items:

        0. **gpu** - Information about the GPUs on the system.
        1. **modelName** - A platform-dependent description of the model of the machine. On Mac OS, this is, for example, 'MacBookPro'. Will be the empty string if not supported.
        2. **modelVersion** - A platform-dependent description of the version of the machine. On Mac OS, this is, for example, '10.1'. Will be the empty string if not supported.
        3. **commandLine** - The command line string used to launch the browser. Will be the empty string if not supported.
    methodzSystemInfo.getInfogpu	modelNamemodelVersioncommandLine)rt   r&   r   cmd_dictr   s     r    get_infor   :  so       	&H >>D$u+&&DD !!D  	 r"   feature_stater   0typing.Generator[T_JSON_DICT, T_JSON_DICT, bool]c              #  h   K   t                      }| |d<   d|d}|V }t          |d                   S )z`
    Returns information about the feature state.

    :param feature_state:
    :returns: 
    featureStatezSystemInfo.getFeatureState)r   paramsfeatureEnabled)r   bool)r   r   r   r   s       r    get_feature_stater   Q  sL       &&F*F>. H >>D%&'''r"   Dtyping.Generator[T_JSON_DICT, T_JSON_DICT, typing.List[ProcessInfo]]c               #  :   K   ddi} | V }d |d         D             S )zj
    Returns information about all running processes.

    :returns: An array of process info blocks.
    r   zSystemInfo.getProcessInfoc                B    g | ]}t                               |          S r-   )r   r&   rm   s     r    rp   z$get_process_info.<locals>.<listcomp>n  s&    BBBK!!!$$BBBr"   processInfor-   r   s     r    get_process_infor   d  s9       	-H >>DBBd=.ABBBBr"   )r   r   )r   r   r   r   )r   r   )
__future__r   utilr   r   dataclassesr   enumtypingr	   r/   r7   r@   EnumrH   rX   rb   rt   r   r   r   r   r-   r"   r    <module>r      sg   # " " " " " * * * * * * * * ! ! ! ! ! !  
5
 5
 5
 5
 5
 5
 5
 5
p 
 
 
 
 
 
 
 
0 
 
 
 
 
 
 
 
< !
 !
 !
 !
 !
 !
 !
 !
H    	        	      
  
  
  
  
  
  
  
F 0
 0
 0
 0
 0
 0
 0
 0
f 
 
 
 
 
 
 
 
<   .( ( ( (&
C 
C 
C 
C 
C 
Cr"   