
     fb#                        d dl mZ d dl mZ d dl mZ erEd dl mZ d dl mZ ed         Z G d ded	
          Z G d ded	
          Z G d ded	
          Z	nd dl m
Z
 d dl mZ eZeee
f         xZxZZ	 G d d          Z G d d          Z G d d          Z G d d          Z G d d          Z G d de          Z G d de          Z G d d e          Z G d! d"          Zd#S )$    )TYPE_CHECKING)List)Optional)Literal)	TypedDict)portrait	landscapec                   8    e Zd ZU eed<   eed<   eed<   eed<   dS )_MarginOptsleftrighttopbottomN__name__
__module____qualname__float__annotations__     o/var/www/api.educacionweb.es/myenv/lib/python3.11/site-packages/selenium/webdriver/common/print_page_options.pyr   r      s4         


r   r   F)totalc                   $    e Zd ZU eed<   eed<   dS )	_PageOptswidthheightNr   r   r   r   r   r   #   s"         r   r   c                   b    e Zd ZU eed<   eed<   eed<   eed<   eed<   eed<   e	e
         ed<   dS )	
_PrintOptsmarginpage
backgroundorientationscaleshrinkToFit
pageRangesN)r   r   r   r   r   r   boolOrientationr   r   strr   r   r   r   r   '   sd             Ir   r   )Any)Dictc                   8    e Zd ZdZd Zdee         fdZddZdS )_PageSettingsDescriptorz8Descriptor which validates `height` and 'width' of page.c                     || _         d S Nnameselfr1   s     r   __init__z _PageSettingsDescriptor.__init__;       			r   returnc                 B    |j                             | j        d           S r/   )_pagegetr1   r3   objclss      r   __get__z_PageSettingsDescriptor.__get__>   s    y}}TY---r   Nc                      t          |d          | j        |           ||j        | j        <   |j        |j        d<   d S )N_validate_num_propertyr!   )getattrr1   r8   _print_optionsr3   r;   values      r   __set__z_PageSettingsDescriptor.__set__A   sD    .-..ty%@@@$	$)%(Y6"""r   r6   N	r   r   r   __doc__r4   r   r   r=   rD   r   r   r   r-   r-   8   s\        BB  .8E? . . . ./ / / / / /r   r-   c                   8    e Zd ZdZd Zdee         fdZddZdS )_MarginSettingsDescriptorz`Descriptor which validates below attributes.

    - top
    - bottom
    - left
    - right
    c                     || _         d S r/   r0   r2   s     r   r4   z"_MarginSettingsDescriptor.__init__P   r5   r   r6   c                 B    |j                             | j        d           S r/   )_marginr9   r1   r:   s      r   r=   z!_MarginSettingsDescriptor.__get__S   s    {ty$///r   Nc                      t          |d          d| j         |           ||j        | j        <   |j        |j        d<   d S )Nr?   zMargin r    )r@   r1   rL   rA   rB   s      r   rD   z!_MarginSettingsDescriptor.__set__V   sM    .-../D/D/DeLLL!&DI'*{8$$$r   rE   rF   r   r   r   rI   rI   G   s`           08E? 0 0 0 03 3 3 3 3 3r   rI   c                   8    e Zd ZdZd Zdee         fdZddZdS )_ScaleDescriptorz'Scale descriptor which validates scale.c                     || _         d S r/   r0   r2   s     r   r4   z_ScaleDescriptor.__init___   r5   r   r6   c                 @    |j                             | j                  S r/   rA   r9   r1   r:   s      r   r=   z_ScaleDescriptor.__get__b   s    !%%di000r   Nc                      t          |d          | j        |           |dk     s|dk    rt          d          ||j        | j        <   d S )Nr?   g?   z*Value of scale should be between 0.1 and 2)r@   r1   
ValueErrorrA   rB   s      r   rD   z_ScaleDescriptor.__set__e   sV    .-..ty%@@@3;;%!))IJJJ(-49%%%r   rE   rF   r   r   r   rO   rO   \   s\        11  18E? 1 1 1 1. . . . . .r   rO   c                   @    e Zd ZdZddgZd Zdee         fdZd	dZ	dS )
_PageOrientationDescriptorz?PageOrientation descriptor which validates orientation of page.r   r	   c                     || _         d S r/   r0   r2   s     r   r4   z#_PageOrientationDescriptor.__init__q   r5   r   r6   c                 B    |j                             | j        d           S r/   rR   r:   s      r   r=   z"_PageOrientationDescriptor.__get__t       !%%di666r   Nc                 d    || j         vrt          d| j                    ||j        | j        <   d S )Nz!Orientation value must be one of )ORIENTATION_VALUESrU   rA   r1   rB   s      r   rD   z"_PageOrientationDescriptor.__set__w   s?    ///ZAXZZ[[[(-49%%%r   rE   )
r   r   r   rG   r\   r4   r   r(   r=   rD   r   r   r   rW   rW   l   sh        II$k2  78K#8 7 7 7 7. . . . . .r   rW   c                   *    e Zd ZdZdZd Zd ZddZdS )_ValidateTypeDescriptorzEBase Class Descriptor which validates type of any subclass attribute.Nc                     || _         d S r/   r0   )r3   r1   expected_types      r   r4   z _ValidateTypeDescriptor.__init__   r5   r   c                 B    |j                             | j        d           S r/   rR   r:   s      r   r=   z_ValidateTypeDescriptor.__get__   rZ   r   r6   c                     t          || j                  s#t          | j         d| j        j                   ||j        | j        <   d S )Nz should be of type )
isinstancer`   rU   r1   r   rA   rB   s      r   rD   z_ValidateTypeDescriptor.__set__   sQ    %!344 	]	[[d>P>Y[[\\\(-49%%%r   rE   )r   r   r   rG   r`   r4   r=   rD   r   r   r   r^   r^   }   sQ        OOM  7 7 7. . . . . .r   r^   c                       e Zd ZdZeZdS )_ValidateBackGroundz&Expected type of background attribute.Nr   r   r   rG   r'   r`   r   r   r   re   re      s        00MMMr   re   c                       e Zd ZdZeZdS )_ValidateShrinkToFitz)Expected type of shirnk to fit attribute.Nrf   r   r   r   rh   rh      s        33MMMr   rh   c                       e Zd ZdZeZdS )_ValidatePageRangesz'Excepted type of page ranges attribute.N)r   r   r   rG   listr`   r   r   r   rj   rj      s        11MMMr   rj   c                   D   e Zd Z ed          Z	  ed          Z	  ed          Z	  ed          Z	  ed          Z		  ed          Z
	  ed          Z	  ed          Z	  ed	e          Z	  ed
e          Z	  ede          Z	 ddZdefdZdededdfdZdS )PrintOptionsr   r   r   r   r   r   r$   r#   r"   r%   r&   r6   Nc                 0    i | _         i | _        i | _        d S r/   )rA   r8   rL   r3   s    r   r4   zPrintOptions.__init__  s    *, "
$&r   c                     | j         S )z-:Returns: A hash of print options configured.)rA   ro   s    r   to_dictzPrintOptions.to_dict  s    ""r   property_namerC   c                     t          |t          t          f          st          | d          |dk     rt          | d          dS )z3Helper function to validate some of the properties.z  should be an integer or a floatr   z cannot be less then 0N)rc   intr   rU   )r3   rr   rC   s      r   r?   z#PrintOptions._validate_num_property  sW    %#u.. 	QOOOPPP199EEEFFF 9r   rE   )r   r   r   r-   page_height
page_widthrI   
margin_topmargin_bottommargin_leftmargin_rightrO   r$   rW   r#   re   r'   r"   rh   shrink_to_fitrj   rk   page_rangesr4   r   rq   r)   r   r?   r   r   r   rm   rm      sv       ))(33K* )(11J* +*511J* .-h77M* ,+F33K* -,W55L* W%%E* -,];;K* %$\488J* )(==M* &%lD99K*' ' ' '
# # # # #GC G G$ G G G G G Gr   rm   N)typingr   r   r   r   r   r(   r   r   r   r*   r+   r)   r-   rI   rO   rW   r^   re   rh   rj   rm   r   r   r   <module>r~      s  & !                       :      12K    iu        IU        Ye      K+/S>9K9)j/ / / / / / / /3 3 3 3 3 3 3 3*. . . . . . . . . . . . . . . .". . . . . . . ."    1       2       1   BG BG BG BG BG BG BG BG BG BGr   