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

Method folders

pattern/web/imap/__init__.py:155–165  ·  view source on GitHub ↗

A dictionary of (name, MailFolder)-tuples. Default folders: inbox, trash, spam, receipts, ...

(self)

Source from the content-addressed store, hash-verified

153
154 @property
155 def folders(self):
156 """ A dictionary of (name, MailFolder)-tuples.
157 Default folders: inbox, trash, spam, receipts, ...
158 """
159 if self._folders is None:
160 status, response = self.imap4.list()
161 self._folders = [f.split(" \"")[-1].strip(" \"") for f in response]
162 self._folders = [(_basename(f), MailFolder(self, f)) for f in self._folders]
163 self._folders = [(f, o) for f, o in self._folders if f != ""]
164 self._folders = dict(self._folders)
165 return self._folders
166
167 def __getattr__(self, k):
168 """ Each folder is accessible as Mail.[name].

Callers

nothing calls this directly

Calls 5

_basenameFunction · 0.85
MailFolderClass · 0.85
listMethod · 0.80
stripMethod · 0.80
splitMethod · 0.45

Tested by

no test coverage detected