HEX
Server: LiteSpeed
System: Linux shams.tasjeel.ae 5.14.0-611.5.1.el9_7.x86_64 #1 SMP PREEMPT_DYNAMIC Tue Nov 11 08:09:09 EST 2025 x86_64
User: infowars (1469)
PHP: 8.2.29
Disabled: NONE
Upload Files
File: //lib64/python3.9/site-packages/ldap/__pycache__/modlist.cpython-39.pyc
a

�.d�
�@s0dZddlmZddlZddd�Zd	dd�ZdS)
z[
ldap.modlist - create add/modify modlist's

See https://www.python-ldap.org/ for details.
�)�__version__NcCsZdd�|pgD�}g}|��D]6\}}|��|vr4qdd�|D�}|r|�||f�q|S)z5Build modify list for call of method LDAPObject.add()cSsh|]}|���qS���lower��.0�vrr�2/usr/lib64/python3.9/site-packages/ldap/modlist.py�	<setcomp>�zaddModlist.<locals>.<setcomp>cSsg|]}|dur|�qS�Nr�r�itemrrr	�
<listcomp>rzaddModlist.<locals>.<listcomp>)�itemsr�append)�entry�ignore_attr_types�modlist�attrtype�valueZ
attrvaluelistrrr	�
addModlistsrcCs�dd�|pgD�}dd�|pgD�}g}i}|D]}|||��<q0|��D�]\}}	|��}
|
|vrfqJdd�|	D�}|
|vr�|�||
g�}dd�|D�}||
=ng}|s�|r�|�tj||f�qJ|�rP|�rPt|�t|�k}
|
�s$|
|v�rdd�|D�}dd�|D�}nt|�}t|�}||k}
|
�rj|�tj|d	f�|�tj||f�qJ|rJ|sJ|�tj|d	f�qJ|�s�|��D].\}}||v�r��qz|}|�tj|d	f��qz|S)
a�
  Build differential modify list for calling LDAPObject.modify()/modify_s()

  old_entry
      Dictionary holding the old entry
  new_entry
      Dictionary holding what the new entry should be
  ignore_attr_types
      List of attribute type names to be ignored completely
  ignore_oldexistent
      If non-zero attribute type names which are in old_entry
      but are not found in new_entry at all are not deleted.
      This is handy for situations where your application
      sets attribute value to '' for deleting an attribute.
      In most cases leave zero.
  case_ignore_attr_types
      List of attribute type names for which comparison will be made
      case-insensitive
  cSsh|]}|���qSrrrrrr	r
1rz modifyModlist.<locals>.<setcomp>cSsh|]}|���qSrrrrrr	r
2rcSsg|]}|dur|�qSrrr
rrr	r=rz!modifyModlist.<locals>.<listcomp>cSsg|]}|dur|�qSrrr
rrr	r@rcSsh|]}|���qSrrrrrr	r
LrcSsh|]}|���qSrrrrrr	r
MrN)	rr�getr�ldapZMOD_ADD�len�setZ
MOD_DELETE)Z	old_entryZ	new_entryrZignore_oldexistentZcase_ignore_attr_typesrZattrtype_lower_map�arrZattrtype_lowerZ	new_value�	old_valueZreplace_attr_valueZ
old_value_setZ
new_value_set�valrrr	�
modifyModlistsN

r)N)NrN)�__doc__rrrrrrrr	�<module>s

�