o
    g                     @   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valuealready_hashed r   W/var/www/html/api-tag/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
    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!   r0   r&   r+   r   r"   r.   r1   r2   )r   r   r#   r'   r-   r/   r(   r*   r$   r%   r)   r,   r    r!   r0   r&   r+   r   r"   r.   r1   r2   r   r   r   __init__K   s,   
zSheetProtection.__init__r
   c                    s   t  || |   d S r3   )superr   enabler   	__class__r   r   r   i   s   zSheetProtection.set_passwordc                 C   
   d| _ d S )NTr   r   r   r   r   r6   n      
zSheetProtection.enablec                 C   r9   )NFr:   r   r   r   r   disabler   r;   zSheetProtection.disablec                 C   r   r3   r:   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!   r0   r&   r+   r   r.   r   r1   r   r"   r2   	__attrs__r4   r   r6   r<   r=   __classcell__r   r   r7   r   r   $   sH    




r   N)openpyxl.descriptorsr   r   r   r   !openpyxl.descriptors.serialisabler   openpyxl.descriptors.excelr   openpyxl.utils.protectionr   r	   r   r   r   r   r   <module>   s   