コード例 #1
0
ファイル: EmailDocument.py プロジェクト: Verde1705/erp5
  def getContentType(self, default=_MARKER):
    """
    Returns the format of the email (text or html).

    TODO: add support for legacy objects
    """
    if not self.hasFile():
      # Return the standard text format if no file was provided
      if default is _MARKER:
        return TextDocument.getContentType(self)
      else:
        return TextDocument.getContentType(self, default)
    else:
      part = self._getMessageTextPart()
      if part is None:
        return 'text/plain'
      else:
        return part.get_content_type()
コード例 #2
0
ファイル: EmailDocument.py プロジェクト: poses/erp5
 def getContentType(self, default=_MARKER):
     """
 Returns the format of the email (text or html).
 
 TODO: add support for legacy objects
 """
     if not self.hasFile():
         # Return the standard text format if no file was provided
         if default is _MARKER:
             return TextDocument.getContentType(self)
         else:
             return TextDocument.getContentType(self, default)
     else:
         part = self._getMessageTextPart()
         if part is None:
             return 'text/plain'
         else:
             return part.get_content_type()
コード例 #3
0
ファイル: EmailDocument.py プロジェクト: Verde1705/erp5
 def getContentURLList(self):
   """
     Overriden to include emails as URLs
   """
   result = TextDocument.getContentURLList(self)
   result.extend(re.findall(self.email_parser, self.getSender('')))
   result.extend(re.findall(self.email_parser, self.getRecipient('')))
   result.extend(re.findall(self.email_parser, self.getCcRecipient('')))
   result.extend(re.findall(self.email_parser, self.getBccRecipient('')))
   return result
コード例 #4
0
ファイル: EmailDocument.py プロジェクト: poses/erp5
 def getContentURLList(self):
     """
   Overriden to include emails as URLs
 """
     result = TextDocument.getContentURLList(self)
     result.extend(re.findall(self.email_parser, self.getSender('')))
     result.extend(re.findall(self.email_parser, self.getRecipient('')))
     result.extend(re.findall(self.email_parser, self.getCcRecipient('')))
     result.extend(re.findall(self.email_parser, self.getBccRecipient('')))
     return result