
    Mwg                     l    d dl mZmZmZmZ d dlmZ d dlmZ d dl	m
Z
  G d d      Z G d dee      Zy	)
    )BoolStringAliasInteger)Serialisable)Base64Binary)hash_passwordc                   L    e Zd ZdZddZed        Zej                  d        Zy)
_ProtectedNc                 ,    |st        |      }|| _        y)zSet a password on this sheet.N)r	   	_password)selfvaluealready_hasheds      T/var/www/horilla/myenv/lib/python3.12/site-packages/openpyxl/worksheet/protection.pyset_passwordz_Protected.set_password   s    !%(E    c                     | j                   S )z.Return the password value, regardless of hash.)r   r   s    r   passwordz_Protected.password   s     ~~r   c                 &    | j                  |       y)z-Set a password directly, forcing a hash step.N)r   )r   r   s     r   r   z_Protected.password   s     	% r    F)__name__
__module____qualname__r   r   propertyr   setter r   r   r   r      s8    I   __! !r   r   c                       e Zd ZdZdZ e       Z ed      Z e       Z	 e       Z
 e       Z e       Z e       Z e       Z e       Z e       Z e       Z e       Z e       Z e       Z e       Z e       Z e       Z ed      Z ed      Z ed      Z ed      ZdZ	 	 	 	 	 	 ddZ d fd	Z!d	 Z"d
 Z#d Z$ xZ%S )SheetProtectionz
    Information about protection of various aspects of a sheet. True values
    mean that protection for the object or action is active This is the
    **default** when protection is active, ie. users cannot do something
    sheetProtectionsheetT)
allow_none)selectLockedCellsselectUnlockedCellsalgorithmNamer#   objects
insertRowsinsertHyperlinks
autoFilter	scenariosformatColumnsdeleteColumnsinsertColumnspivotTables
deleteRowsformatCells	saltValue
formatRowssort	spinCountr   	hashValuec                 .   || _         || _        || _        || _        || _        || _        || _        || _        |	| _        |
| _	        || _
        || _        || _        || _        || _        || _        ||| _        || _        || _        || _        || _        y N)r#   r(   r,   r2   r-   r4   r/   r)   r*   r.   r1   r%   r&   r5   r+   r0   r   r'   r3   r6   r7   )r   r#   r(   r,   r2   r4   r-   r/   r)   r*   r.   r1   r%   r&   r5   r+   r0   r   r'   r3   r6   r7   s                         r   __init__zSheetProtection.__init__K   s     
"&*$*$ 0*$!2#6 	$&$DM*"""r   c                 F    t         |   ||       | j                          y r9   )superr   enable)r   r   r   	__class__s      r   r   zSheetProtection.set_passwordi   s    UN3r   c                     d| _         y )NTr#   r   s    r   r=   zSheetProtection.enablen   s	    
r   c                     d| _         y )NFr@   r   s    r   disablezSheetProtection.disabler   s	    
r   c                     | j                   S r9   r@   r   s    r   __bool__zSheetProtection.__bool__v   s    zzr   )FFFTTTTTTTTFFTTTNNNNNr   )&r   r   r   __doc__tagnamer   r#   r   enabledr(   r,   r2   r-   r4   r/   r)   r*   r.   r1   r%   r&   r5   r+   r0   r   r3   r   r6   r   r'   r7   	__attrs__r:   r   r=   rB   rD   __classcell__)r>   s   @r   r!   r!   $   s      GFEGnGfGI&KFMJFMJvFMJ&6DJ&K-I4(Id+M-I<I >CBFGKHMTX^b#<
r   r!   N)openpyxl.descriptorsr   r   r   r   !openpyxl.descriptors.serialisabler   openpyxl.descriptors.excelr   openpyxl.utils.protectionr	   r   r!   r   r   r   <module>rN      s8     ; 4! !(SlJ Sr   