U
    Ÿ‹®g.  ã                   @   sH   d Z ddlmZmZmZmZ ddlZddlZG dd„ deƒZ	dd„ Z
dS )z=
Exports the following items:

 - unwrap()
 - APIException()
é    )Úunicode_literalsÚdivisionÚabsolute_importÚprint_functionNc                   @   s   e Zd ZdZdS )ÚAPIExceptionzI
    An exception indicating an API has been removed from asn1crypto
    N)Ú__name__Ú
__module__Ú__qualname__Ú__doc__© r   r   ú6/tmp/pip-unpacked-wheel-etcy_95o/asn1crypto/_errors.pyr      s   r   c                 G   s>   t  | ¡}| d¡dkr&t dd|¡}|r2|| }| ¡ }|S )a_  
    Takes a multi-line string and does the following:

     - dedents
     - converts newlines with text before and after into a single line
     - strips leading and trailing whitespace

    :param string:
        The string to format

    :param *params:
        Params to interpolate into the string

    :return:
        The formatted string
    Ú
éÿÿÿÿz(?<=\S)
(?=[^ 
	\d\*\-=])ú )ÚtextwrapÚdedentÚfindÚreÚsubÚstrip)ÚstringÚparamsÚoutputr   r   r   Úunwrap   s    
r   )r
   Ú
__future__r   r   r   r   r   r   Ú	Exceptionr   r   r   r   r   r   Ú<module>   s
   