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()
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