home *** CD-ROM | disk | FTP | other *** search
/ Maximum CD 2010 November / maximum-cd-2010-11.iso / DiscContents / calibre-0.7.13.msi / file_434 (.txt) < prev    next >
Encoding:
Python Compiled Bytecode  |  2010-08-06  |  900 b   |  24 lines

  1. # Source Generated with Decompyle++
  2. # File: in.pyc (Python 2.6)
  3.  
  4. __all__ = [
  5.     'MIMEImage']
  6. import imghdr
  7. from email import encoders
  8. from email.mime.nonmultipart import MIMENonMultipart
  9.  
  10. class MIMEImage(MIMENonMultipart):
  11.     
  12.     def __init__(self, _imagedata, _subtype = None, _encoder = encoders.encode_base64, **_params):
  13.         if _subtype is None:
  14.             _subtype = imghdr.what(None, _imagedata)
  15.         
  16.         if _subtype is None:
  17.             raise TypeError('Could not guess image MIME subtype')
  18.         _subtype is None
  19.         MIMENonMultipart.__init__(self, 'image', _subtype, **_params)
  20.         self.set_payload(_imagedata)
  21.         _encoder(self)
  22.  
  23.  
  24.