Logo Search packages:      
Sourcecode: pythoncard version File versions  Download package

def manilaaccount::ManilaAccount::manilaAttachPicture (   self,
  msgNum,
  pictureFilename,
  mimeType 
)

Reads in an image from a file, and attaches it to the specified message.

Definition at line 120 of file manilaaccount.py.

00120                                                                     :
        """Reads in an image from a file, and attaches it to the specified message."""
        if (not self.checkSetupOK()):
            return 0
        
        try:
            file = open(pictureFilename, "rb")
            picData = file.read()
            file.close()
        except IOError, e:
            self.status("Couldn't open image file '%s'." % pictureFilename)
            return

        picture = xmlrpclib.Binary(picData)
        
        try:
            boolTrue = xmlrpclib.Boolean(1)
            self.manilaSite.manila.message.attachPicture(self.prefs["username"], \
                                                         self.getPassword(), \
                                                         self.settings["sitename"], \
                                                         msgNum, \
                                                         mimeType, \
                                                         picture )

            self.manilaSite.manila.message.addToPicturesList(self.prefs["username"], \
                                                         self.getPassword(), \
                                                         self.settings["sitename"], \
                                                         msgNum,)

            self.setErrorMessage("")
        except xmlrpclib.Fault, e:
            self.setErrorMessage("Error attaching picture to message: %s" % e.faultString)

    def manilaAddToStoriesList(self, msg):


Generated by  Doxygen 1.6.0   Back to index