o
    ßý°j?  ã                   @   sp   d Z ddlmZ ddlmZ ddlmZ ddlmZmZ ddl	m
Z
 dd	lmZ dd
lmZ G dd„ de
ƒZdS )Ú
é    )Údatetime)ÚIntegeré   )ÚLDAPExtensionError)ÚLDAPDNÚReplicaInfoRequestValueé   )ÚExtendedOperation)Údecoder)Úsafe_dnc                   @   s&   e Zd Zdd„ Zddd„Zdd„ ZdS )	ÚReplicaInfoc                 C   s   d| _ d| _tƒ | _d| _d S )Nz2.16.840.1.113719.1.27.100.17z2.16.840.1.113719.1.27.100.18Úpartition_dn)Úrequest_nameÚresponse_namer   Úrequest_valueÚresponse_attribute)Úself© r   ú’/root/aizidognhua/tmp/workspace/projects/ec89d86c-575f-41c9-af57-ac45cbdbf775/venv/lib/python3.10/site-packages/ldap3/extend/novell/replicaInfo.pyÚconfig&   s   
zReplicaInfo.configNc                 C   sD   |j r|r	t|ƒ}|rt|ƒ}t | ||¡ || jd< || jd< d S )NÚ	server_dnr   )Úcheck_namesr   r
   Ú__init__r   )r   Ú
connectionr   r   Úcontrolsr   r   r   r   -   s   
zReplicaInfo.__init__c                 C   sN  | j }z�tj|tƒ d�\}}t|ƒ| jd< tj|tƒ d�\}}t|ƒ| jd< tj|tƒ d�\}}t t|ƒ¡| jd< tj|tƒ d�\}}t t|ƒ¡| jd< tj|tƒ d�\}}t|ƒ| jd< tj|tƒ d�\}}t	|ƒ| jd< tj|tƒ d�\}}t|ƒ| jd< tj|tƒ d�\}}t|ƒ| jd	< W n t
yž   td
ƒ‚w |r¥tdƒ‚d S )N)Úasn1SpecÚpartition_idÚreplica_stateÚmodification_timeÚ
purge_timeÚlocal_partition_idr   Úreplica_typeÚflagszunable to decode substratezunknown substrate remaining)Údecoded_responser   Údecoder   ÚintÚresultr   Úutcfromtimestampr   ÚstrÚ	Exceptionr   )r   Ú	substrateÚdecodedr   r   r   Úpopulate_result8   s0   ÿÿzReplicaInfo.populate_result)N)Ú__name__Ú
__module__Ú__qualname__r   r   r-   r   r   r   r   r   %   s    
r   N)Ú__doc__r   Úpyasn1.type.univr   Úcore.exceptionsr   Úprotocol.novellr   r   Ú	operationr
   Ú
utils.asn1r   Úutils.dnr   r   r   r   r   r   Ú<module>   s    