add-determinism 0.7.3

RPM buildroot helper to strip nondeterministic bits in files
Documentation
U

�AT^�#c@s�ddlZddlZddlZddlmZe�d�ZdZdZdd�Z	dd	�Z
d
d�ZGdd
�d
ej�ZGdd�dej
�ZGdd�dej�ZGdd�deej�ZGdd�deej�Zdd�ZdS)�N)�	ucd_3_2_0u[.。.。]sxn--zxn--cCsg}|D] }t�|�rq|�t�|��qd�|�}t�d|�}|D]j}t�|�s�t�|�s�t�	|�s�t�
|�s�t�|�s�t�|�s�t�
|�s�t�|�s�t�|�rDtd|��qDdd�|D�}|D]:}|r�tdd�|D��r�td��|d	r�|d
s�td��q�|S)N�ZNFKCzInvalid character %rcSsg|]}t�|��qS�)�
stringprepZin_table_d1�Z.0Zxrr�&/usr/lib64/python3.8/encodings/idna.pyZ
<listcomp>)sznameprep.<locals>.<listcomp>css|]}t�|�VqdS)N)rZin_table_d2rrrrZ	<genexpr>2sznameprep.<locals>.<genexpr>zViolation of BIDI requirement 2r�����zViolation of BIDI requirement 3)rZin_table_b1�appendZmap_table_b2�join�unicodedataZ	normalizeZin_table_c12Zin_table_c22Zin_table_c3Zin_table_c4Zin_table_c5Zin_table_c6Zin_table_c7Zin_table_c8Zin_table_c9�UnicodeErrorZany)�labelZnewlabelZcZRandALrrr�nameprepsD


��������	
r
cCs�z|�d�}Wntk
r"Yn*Xdt|�kr<dkrDnn|Std��t|�}z|�d�}Wntk
rvYn*Xdt|�kr�dkr�nn|Std��|�t�r�td��|�d�}t|}dt|�kr�dkr�nn|Std��dS)N�asciir�@�label empty or too longzLabel starts with ACE prefix�punycode)�encoder�lenr
�
startswith�sace_prefix�
ace_prefix)rrrr�ToASCII>s,

rcCs�t|t�rd}n,z|�d�}d}Wntk
r:d}YnX|stt|�}z|�d�}Wntk
rrtd��YnX|�t�s�t|d�S|tt�d�}|�	d�}t
|�}t|d���t|d�kr�td||��|S)NTrFzInvalid character in IDN labelrzIDNA does not round-trip)�
isinstance�bytesrrr
rr�strr�decoderZlower)rZ
pure_asciiZlabel1�resultZlabel2rrr�	ToUnicodeis*





rc@s eZdZddd�Zddd�ZdS)	�Codec�strictcCs|dkrtd|��|sdSz|�d�}Wntk
r>YndX|�d�}|dd�D]&}dt|�krrdksVntd	��qVt|d�dkr�td
��|t|�fSt�}t�|�}|r�|ds�d}|d=nd}|D] }|r�|�d�|�t|��q�t	||�t|�fS)Nr�unsupported error handling ��rr�.rrrrzlabel too longr")
rrZUnicodeEncodeError�splitr�	bytearray�dots�extendrr)�self�input�errorsr�labelsr�trailing_dotrrrr�s4



zCodec.encodecCs�|dkrtd|��|sdSt|t�s.t|�}t|kr`z|�d�t|�fWStk
r^YnX|�d�}|r�t|d�dkr�d}|d=nd	}g}|D]}|�t	|��q�d�
|�|t|�fS)
Nr�Unsupported error handling �rrrr#rr�.r)rrrrrrZUnicodeDecodeErrorr$rrr	)r(r)r*r+r,rrrrrr�s(

zCodec.decodeN�rr0)�__name__�
__module__�__qualname__rrrrrrr�s
%rc@�eZdZdd�ZdS)�IncrementalEncoderc	Cs�|dkrtd|��|sdSt�|�}d}|rT|dsBd}|d=n|sT|d=|rTd}t�}d}|D]4}|r||�d�|d7}|�t|��|t|�7}qb||7}|t|�7}t|�|fS)	Nrr r!r"rr#r�)rr&r$r%r'rrr�	r(r)r*Zfinalr+r,rZsizerrrr�_buffer_encode�s2

z!IncrementalEncoder._buffer_encodeN)r1r2r3r8rrrrr5��r5c@r4)�IncrementalDecoderc	Cs�|dkrtd|��|sdSt|t�r2t�|�}nt|d�}|�d�}d}|rt|dsbd}|d=n|st|d=|rtd}g}d}|D]*}|�t|��|r�|d	7}|t|�7}q�d�|�|}|t|�7}||fS)
Nrr-r.rr/rrrr6)	rrrr&r$rrrr	r7rrr�_buffer_decode�s6


z!IncrementalDecoder._buffer_decodeN)r1r2r3r;rrrrr:�r9r:c@�eZdZdS)�StreamWriterN�r1r2r3rrrrr=$r9r=c@r<)�StreamReaderNr>rrrrr?'r9r?c	Cs tjdt�jt�jttttd�S)NZidna)ZnamerrZincrementalencoderZincrementaldecoderZstreamwriterZstreamreader)	�codecsZ	CodecInforrrr5r:r=r?rrrr�getregentry,s�rA)rZrer@r
rZcompiler&rrr
rrrZBufferedIncrementalEncoderr5ZBufferedIncrementalDecoderr:r=r?rArrrrZ<module>s
0+)H#'