3
πi`  γ               @   sΎ  d Z ddlmZ ddlmZ ddlmZ ddlmZ G dd deZG dd	 d	eZ	G d
d de	Z
G dd de	ZG dd deeZG dd deZG dd deZG dd deZG dd deZG dd deZG dd deZG dd deZG dd deZeZG d d! d!eZG d"d# d#eZG d$d% d%eZG d&d' d'eZG d(d) d)eZG d*d+ d+eZG d,d- d-eZG d.d/ d/eZG d0d1 d1eZ G d2d3 d3eZ!G d4d5 d5eZ"d6S )7z email package exception classes.ι    )Ϊunicode_literals)Ϊdivision)Ϊabsolute_import)Ϊsuperc               @   s   e Zd ZdZdS )ΪMessageErrorz+Base class for errors in the email package.N)Ϊ__name__Ϊ
__module__Ϊ__qualname__Ϊ__doc__© r   r   ϊ?/tmp/pip-build-6m2fasei/future/future/backports/email/errors.pyr      s   r   c               @   s   e Zd ZdZdS )ΪMessageParseErrorz&Base class for message parsing errors.N)r   r   r	   r
   r   r   r   r   r      s   r   c               @   s   e Zd ZdZdS )ΪHeaderParseErrorzError while parsing headers.N)r   r   r	   r
   r   r   r   r   r      s   r   c               @   s   e Zd ZdZdS )ΪBoundaryErrorz#Couldn't find terminating boundary.N)r   r   r	   r
   r   r   r   r   r      s   r   c               @   s   e Zd ZdZdS )ΪMultipartConversionErrorz(Conversion to a multipart is prohibited.N)r   r   r	   r
   r   r   r   r   r      s   r   c               @   s   e Zd ZdZdS )ΪCharsetErrorzAn illegal charset was given.N)r   r   r	   r
   r   r   r   r   r       s   r   c                   s"   e Zd ZdZd fdd	Z  ZS )ΪMessageDefectz Base class for a message defect.Nc                s   |d k	rt  j| || _d S )N)r   Ϊ__init__Ϊline)Ϊselfr   )Ϊ	__class__r   r   r   (   s    zMessageDefect.__init__)N)r   r   r	   r
   r   Ϊ__classcell__r   r   )r   r   r   %   s   r   c               @   s   e Zd ZdZdS )ΪNoBoundaryInMultipartDefectzBA message claimed to be a multipart but had no boundary parameter.N)r   r   r	   r
   r   r   r   r   r   -   s   r   c               @   s   e Zd ZdZdS )ΪStartBoundaryNotFoundDefectz+The claimed start boundary was never found.N)r   r   r	   r
   r   r   r   r   r   0   s   r   c               @   s   e Zd ZdZdS )ΪCloseBoundaryNotFoundDefectzEA start boundary was found, but not the corresponding close boundary.N)r   r   r	   r
   r   r   r   r   r   3   s   r   c               @   s   e Zd ZdZdS )Ϊ#FirstHeaderLineIsContinuationDefectz;A message had a continuation line as its first header line.N)r   r   r	   r
   r   r   r   r   r   6   s   r   c               @   s   e Zd ZdZdS )ΪMisplacedEnvelopeHeaderDefectz?A 'Unix-from' header was found in the middle of a header block.N)r   r   r	   r
   r   r   r   r   r   9   s   r   c               @   s   e Zd ZdZdS )Ϊ MissingHeaderBodySeparatorDefectzEFound line with no leading whitespace and no colon before blank line.N)r   r   r	   r
   r   r   r   r   r   <   s   r   c               @   s   e Zd ZdZdS )Ϊ!MultipartInvariantViolationDefectz?A message claimed to be a multipart but no subparts were found.N)r   r   r	   r
   r   r   r   r   r   A   s   r   c               @   s   e Zd ZdZdS )Ϊ-InvalidMultipartContentTransferEncodingDefectzEAn invalid content transfer encoding was set on the multipart itself.N)r   r   r	   r
   r   r   r   r   r   D   s   r   c               @   s   e Zd ZdZdS )ΪUndecodableBytesDefectz0Header contained bytes that could not be decodedN)r   r   r	   r
   r   r   r   r   r    G   s   r    c               @   s   e Zd ZdZdS )ΪInvalidBase64PaddingDefectz/base64 encoded sequence had an incorrect lengthN)r   r   r	   r
   r   r   r   r   r!   J   s   r!   c               @   s   e Zd ZdZdS )ΪInvalidBase64CharactersDefectz=base64 encoded sequence had characters not in base64 alphabetN)r   r   r	   r
   r   r   r   r   r"   M   s   r"   c                   s    e Zd ZdZ fddZ  ZS )ΪHeaderDefectzBase class for a header defect.c                s   t  j|| d S )N)r   r   )r   ΪargsΪkw)r   r   r   r   U   s    zHeaderDefect.__init__)r   r   r	   r
   r   r   r   r   )r   r   r#   R   s   r#   c               @   s   e Zd ZdZdS )ΪInvalidHeaderDefectz+Header is not valid, message gives details.N)r   r   r	   r
   r   r   r   r   r&   X   s   r&   c               @   s   e Zd ZdZdS )ΪHeaderMissingRequiredValuez(A header that must have a value had noneN)r   r   r	   r
   r   r   r   r   r'   [   s   r'   c                   s(   e Zd ZdZ fddZdd Z  ZS )ΪNonPrintableDefectz8ASCII characters outside the ascii-printable range foundc                s   t  j| || _d S )N)r   r   Ϊnon_printables)r   r)   )r   r   r   r   a   s    zNonPrintableDefect.__init__c             C   s   dj | jS )Nz6the following ASCII non-printables found in header: {})Ϊformatr)   )r   r   r   r   Ϊ__str__e   s    zNonPrintableDefect.__str__)r   r   r	   r
   r   r+   r   r   r   )r   r   r(   ^   s   r(   c               @   s   e Zd ZdZdS )ΪObsoleteHeaderDefectz0Header uses syntax declared obsolete by RFC 5322N)r   r   r	   r
   r   r   r   r   r,   i   s   r,   c               @   s   e Zd ZdZdS )ΪNonASCIILocalPartDefectz(local_part contains non-ASCII charactersN)r   r   r	   r
   r   r   r   r   r-   l   s   r-   N)#r
   Ϊ
__future__r   r   r   Zfuture.builtinsr   Ϊ	Exceptionr   r   r   r   Ϊ	TypeErrorr   r   Ϊ
ValueErrorr   r   r   r   r   r   r   ΪMalformedHeaderDefectr   r   r    r!   r"   r#   r&   r'   r(   r,   r-   r   r   r   r   Ϊ<module>   s:   