MCPcopy Index your code
hub / github.com/clips/pattern / Message

Class Message

pattern/web/imap/__init__.py:287–313  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

285#--- MAIL MESSAGE ----------------------------------------------------------------------------------
286
287class Message(dict):
288
289 @property
290 def author(self):
291 return self.get(FROM, None)
292 @property
293 def date(self):
294 return self.get(DATE, None)
295 @property
296 def subject(self):
297 return self.get(SUBJECT, "")
298 @property
299 def body(self):
300 return self.get(BODY, "")
301 @property
302 def attachments(self):
303 return self.get(ATTACHMENTS, [])
304
305 @property
306 def email_address(self):
307 m = re.search(r"<(.*?)>", self.author)
308 return m and m.group(1) or ""
309
310 def __repr__(self):
311 return "Message(from=%s, subject=%s)" % (
312 repr(self.author),
313 repr(self.subject))

Callers 1

__getitem__Method · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…