o
    ϩZh                     @   s`   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 dZG dd deeZd	S )
    )BoolStringAliasInteger)Serialisable)Base64Binary)hash_passwordc                   @   s4   e Zd ZdZd	ddZedd Zejdd ZdS )

_ProtectedN Fc                 C   s   |st |}|| _dS )zSet a password on this sheet.N)r   	_passwordselfvalueZalready_hashed r   T/var/www/html/lang_env/lib/python3.10/site-packages/openpyxl/worksheet/protection.pyset_password   s   
z_Protected.set_passwordc                 C      | j S )z.Return the password value, regardless of hash.)r   r   r   r   r   password   s   z_Protected.passwordc                 C   s   |  | dS )z-Set a password directly, forcing a hash step.N)r   )r   r   r   r   r   r      s   r
   F)__name__
__module____qualname__r   r   propertyr   setterr   r   r   r   r	      s    

r	   c                       s   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dZeddZeddZeddZdZ						dd	d
Z d fdd	Z!dd Z"dd Z#dd Z$  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
    ZsheetProtectionsheetT)
allow_none)selectLockedCellsselectUnlockedCellsalgorithmNamer   objects
insertRowsinsertHyperlinks
autoFilter	scenariosformatColumnsdeleteColumnsinsertColumnspivotTables
deleteRowsformatCells	saltValue
formatRowssort	spinCountr   	hashValueFNc                 C   s   || _ || _|| _|| _|| _|| _|| _|| _|	| _|
| _	|| _
|| _|| _|| _|| _|| _|d ur7|| _|| _|| _|| _|| _d S N)r   r!   r%   r+   r&   r-   r(   r"   r#   r'   r*   r   r   r.   r$   r)   r   r    r,   r/   r0   )r   r   r!   r%   r+   r-   r&   r(   r"   r#   r'   r*   r   r   r.   r$   r)   r   r    r,   r/   r0   r   r   r   __init__K   s,   
zSheetProtection.__init__r
   c                    s   t  || |   d S r1   )superr   enabler   	__class__r   r   r   i   s   zSheetProtection.set_passwordc                 C   
   d| _ d S )NTr   r   r   r   r   r4   n      
zSheetProtection.enablec                 C   r7   )NFr8   r   r   r   r   disabler   r9   zSheetProtection.disablec                 C   r   r1   r8   r   r   r   r   __bool__v   s   zSheetProtection.__bool__)FFFTTTTTTTTFFTTTNNNNNr   )&r   r   r   __doc__tagnamer   r   r   enabledr!   r%   r+   r&   r-   r(   r"   r#   r'   r*   r   r   r.   r$   r)   r   r,   r   r/   r   r    r0   	__attrs__r2   r   r4   r:   r;   __classcell__r   r   r5   r   r   $   sH    




r   N)Zopenpyxl.descriptorsr   r   r   r   Z!openpyxl.descriptors.serialisabler   Zopenpyxl.descriptors.excelr   Zopenpyxl.utils.protectionr   r	   r   r   r   r   r   <module>   s   