3 \%ã@s>dZdgZddlZddlmZddlmZGdd„deƒZdS)z/Class representing image/* type MIME documents.Ú MIMEImageéN)Úencoders)ÚMIMENonMultipartc@s&eZdZdZdejfddœdd„ZdS)rz1Class for generating image/* type MIME documents.N)ÚpolicycKsT|dkrtjd|ƒ}|dkr$tdƒ‚tj|d|fd|i|—Ž|j|ƒ||ƒdS)a²Create an image/* type MIME document. _imagedata is a string containing the raw image data. If this data can be decoded by the standard Python `imghdr' module, then the subtype will be automatically included in the Content-Type header. Otherwise, you can specify the specific image subtype via the _subtype parameter. _encoder is a function which will perform the actual encoding for transport of the image data. It takes one argument, which is this Image instance. It should use get_payload() and set_payload() to change the payload to the encoded form. It should also add any Content-Transfer-Encoding or other headers to the message as necessary. The default encoding is Base64. Any additional keyword arguments are passed to the base class constructor, which turns them into parameters on the Content-Type header. Nz"Could not guess image MIME subtypeZimager)ÚimghdrZwhatÚ TypeErrorrÚ__init__Z set_payload)ÚselfZ _imagedataZ_subtypeZ_encoderrZ_params©r ú/usr/lib64/python3.6/image.pyrs  zMIMEImage.__init__)Ú__name__Ú __module__Ú __qualname__Ú__doc__rZ encode_base64rr r r r rs)rÚ__all__rZemailrZemail.mime.nonmultipartrrr r r r Ús