Ejemplo n.º 1
0
def getSharingHeaderInfo(mailItem):
    """ 
    Return the Chandler sharing header's values, split into a handy list: (url, collectionName)
    Throws KeyError if not present. 
    Used by Main and the detail view.
    """
    sharingHeaderName = message.createChandlerHeader(constants.SHARING_HEADER)

    #XXX: Tnis needs to be base 64 unencoded; also, see above.
    sharingHeaderValue = mailItem.chandlerHeaders[sharingHeaderName]

    urlAndCollectionName = sharingHeaderValue.split(constants.SHARING_DIVIDER)
    return urlAndCollectionName
Ejemplo n.º 2
0
def getSharingHeaderInfo(mailItem):
    """ 
    Return the Chandler sharing header's values, split into a handy list: (url, collectionName)
    Throws KeyError if not present. 
    Used by Main and the detail view.
    """
    sharingHeaderName = message.createChandlerHeader(constants.SHARING_HEADER)

    #XXX: Tnis needs to be base 64 unencoded; also, see above.
    sharingHeaderValue = mailItem.chandlerHeaders[sharingHeaderName]
 
    urlAndCollectionName = sharingHeaderValue.split(constants.SHARING_DIVIDER)
    return urlAndCollectionName 
Ejemplo n.º 3
0
    def __createMessage(self):
        self.repository.view.refresh()

        m = Mail.MailMessage(view=self.repository.view)

        m.subject = self.__createSubject()
        m.fromAddress = self.fromAddress

        sendStr = makeSharingHeaderValue(self.url, self.collectionName)
        m.chandlerHeaders[message.createChandlerHeader(constants.SHARING_HEADER)] = sendStr

        for address in self.sendToList:
            assert isinstance(address, Mail.EmailAddress), \
            "sendToList can only contain EmailAddres Object"
            m.toAddress.append(address)

        m.body = utils.strToText(m, "body", self.collectionBody)

        self.repository.view.commit()

        return m
Ejemplo n.º 4
0
    def __createMessage(self):
        self.repository.view.refresh()

        m = Mail.MailMessage(view=self.repository.view)

        m.subject = self.__createSubject()
        m.fromAddress = self.fromAddress

        sendStr = makeSharingHeaderValue(self.url, self.collectionName)
        m.chandlerHeaders[message.createChandlerHeader(
            constants.SHARING_HEADER)] = sendStr

        for address in self.sendToList:
            assert isinstance(address, Mail.EmailAddress), \
            "sendToList can only contain EmailAddres Object"
            m.toAddress.append(address)

        m.body = utils.strToText(m, "body", self.collectionBody)

        self.repository.view.commit()

        return m