MCPcopy Index your code
hub / github.com/RustPython/RustPython / select

Method select

Lib/imaplib.py:843–872  ·  view source on GitHub ↗

Select a mailbox. Flush all untagged responses. (typ, [data]) = .select(mailbox='INBOX', readonly=False) 'data' is count of messages in mailbox ('EXISTS' response). Mandated responses are ('FLAGS', 'EXISTS', 'RECENT', 'UIDVALIDITY'), so other res

(self, mailbox='INBOX', readonly=False)

Source from the content-addressed store, hash-verified

841
842
843 def select(self, mailbox='INBOX', readonly=False):
844 """Select a mailbox.
845
846 Flush all untagged responses.
847
848 (typ, [data]) = <instance>.select(mailbox='INBOX', readonly=False)
849
850 'data' is count of messages in mailbox ('EXISTS' response).
851
852 Mandated responses are ('FLAGS', 'EXISTS', 'RECENT', 'UIDVALIDITY'), so
853 other responses should be obtained via <instance>.response('FLAGS') etc.
854 """
855 self.untagged_responses = {} # Flush old responses.
856 self.is_readonly = readonly
857 if readonly:
858 name = 'EXAMINE'
859 else:
860 name = 'SELECT'
861 typ, dat = self._simple_command(name, mailbox)
862 if typ != 'OK':
863 self.state = 'AUTH' # Might have been 'SELECTED'
864 return typ, dat
865 self.state = 'SELECTED'
866 if 'READ-ONLY' in self.untagged_responses \
867 and not readonly:
868 if __debug__:
869 if self.debug >= 1:
870 self._dump_ur(self.untagged_responses)
871 raise self.readonly('%s is not writable' % mailbox)
872 return typ, self.untagged_responses.get('EXISTS', [None])
873
874
875 def setacl(self, mailbox, who, what):

Callers 5

serve_until_quitMethod · 0.45
_communicateMethod · 0.45
serve_foreverMethod · 0.45
handle_requestMethod · 0.45
stdlib_select.pyFile · 0.45

Calls 4

_simple_commandMethod · 0.95
_dump_urMethod · 0.95
readonlyMethod · 0.45
getMethod · 0.45

Tested by

no test coverage detected