o
    Þý°j¥  ã                   @   s¾   d dl Z d dlmZ d dlmZ d dlmZ ddgZG dd„ dejƒZej	 
¡ Z	e	 ejjeƒ i¡ ej 
¡ Ze ejjeƒ i¡ G d	d
„ d
ejƒZG dd„ dejƒZeƒ Zdefdd„ZdS )é    N)Úerror)Úencoder)ÚunivÚEncoderÚencodec                   @   s   e Zd Zedd„ ƒZdS )Ú
SetEncoderc                    s”   | \‰ }|du rˆ }n|}|j tjj krG|jsG|du r ˆ  ¡ jS ‡ fdd„|jjD ƒ}t|ƒdkr@t 	dt|ƒr:dp;dˆ f ¡‚||d  jS |jS )	zeSort SET components by tag

        Sort depending on the actual Choice value (dynamic sort)
        Nc                    s   g | ]
}|j ˆ v r|j ‘qS © )Úname)Ú.0Ú	namedType©Ú	componentr   ú‹/root/aizidognhua/tmp/workspace/projects/ec89d86c-575f-41c9-af57-ac45cbdbf775/venv/lib/python3.10/site-packages/pyasn1/codec/der/encoder.pyÚ
<listcomp>#   s    
ÿz0SetEncoder._componentSortKey.<locals>.<listcomp>é   z%s components for Choice at %rz	Multiple zNone r   )
ÚtypeIdr   ÚChoiceÚtagSetÚgetComponentÚcomponentTypeÚ
namedTypesÚlenr   ÚPyAsn1Error)ÚcomponentAndTypeÚasn1SpecÚcompTypeÚnamesr   r   r   Ú_componentSortKey   s   
ÿzSetEncoder._componentSortKeyN)Ú__name__Ú
__module__Ú__qualname__Ústaticmethodr   r   r   r   r   r      s    r   c                   @   s   e Zd ZdZdZeZeZdS )ÚSingleItemEncoderTr   N)r   r   r    ÚfixedDefLengthModeÚfixedChunkSizeÚTAG_MAPÚTYPE_MAPr   r   r   r   r"   ?   s
    r"   c                   @   s   e Zd ZeZdS )r   N)r   r   r    r"   ÚSINGLE_ITEM_ENCODERr   r   r   r   r   G   s    Úattrc                 C   sB   dddœ  | ¡ }rtj| › d|› d�tdd� tƒ | S t| ƒ‚)Nr%   r&   )ÚtagMapÚtypeMapz is deprecated. Please use z	 instead.é   )Ú
stacklevel)ÚgetÚwarningsÚwarnÚDeprecationWarningÚglobalsÚAttributeError)r(   ÚnewAttrr   r   r   Ú__getattr__z   s   
r4   )r.   Úpyasn1r   Úpyasn1.codec.cerr   Úpyasn1.typer   Ú__all__r   r%   ÚcopyÚupdateÚSetr   r&   r   r"   r   r   Ústrr4   r   r   r   r   Ú<module>   s$   
 
þ

þ1