postcard/postcard.py
def add_image(self, image):
        """Adds an image to the message in the cid format.
        Args:
            image (tuple): the image should be in the (key, path) format
        Raises:
            ValueError when the file does not exist
        """
        key, filepath = image
        abspath = os.path.abspath(filepath)

        if os.path.exists(abspath):
            with open(abspath, 'rb') as image_file:
                img = image_file.read()
            cid = MIMEImage(img)
            cid.add_header('Content-ID', key)
            self.message.attach(cid)
        else:
            raise ValueError("The path %s does not exist!" % abspath)
Adds an image to the message in the cid format.
        Args:
            image (tuple): the image should be in the (key, path) format
        Raises:
            ValueError when the file does not exist
        
Adds an image to the message in the cid format.
Args:
image (tuple): the image should be in the (key, path) format
Raises:
ValueError when the file does not exist
Adds an image to the message in the cid format . Args : image ( tuple ) : the image should be in the ( key path ) format Raises : ValueError when the file does not exist
def add_image(self, image):
        key, filepath = image
        abspath = os.path.abspath(filepath)
        if os.path.exists(abspath):
            with open(abspath, 'rb') as image_file:
                img = image_file.read()
            cid = MIMEImage(img)
            cid.add_header('Content-ID', key)
            self.message.attach(cid)
        else:
            raise ValueError("The path %s does not exist!" % abspath)
def add_image ( self , image ) : key , filepath = image abspath = os . path . abspath ( filepath ) if os . path . exists ( abspath ) : with open ( abspath , 'rb' ) as image_file : img = image_file . read ( ) cid = MIMEImage ( img ) cid . add_header ( 'Content-ID' , key ) self . message . attach ( cid ) else : raise ValueError ( "The path %s does not exist!" % abspath )
Adds an image to the message in the cid format.
Adds an image to the message in the cid format .
"""Adds an image to the message in the cid format.
        Args:
            image (tuple): the image should be in the (key, path) format
        Raises:
            ValueError when the file does not exist
        """
self
image